Configuring Devmon for the first time
list Josh Luthman
Sorry for the long post, just trying to put all the information I think is relevant in one place! I believe I have Devmon all ready to go short of one example test. I copied the templates from SF and put them in the templates directory. I am trying this with apc-9619. From what I've read, it simply looks to match a string in sysdesc of templates/apc-9619/specs with what comes back from the sysDescr snmp query. This is what I have: # more templates/apc-9619/specs vendor : apc model : 9619 snmpver : 1 sysdesc : *MN:AP9619* # snmpwalk -v1 -ccommunity 172.16.0.60|grep MN\:AP9619 SNMPv2-MIB::sysDescr.0 = STRING: APC Web/SNMP Management Card (MB:v3.9.2 PF:v3.6.1 PN:apc_hw02_aos_361.bin AF1:v3.5.8 AN1:apc_hw02_sumx_358.bin *MN:AP9619 *HR:A10 SN: NA0829011474 MD:07/19/2008) (Embedded PowerNet SNMP Agent SW v2.2 compatible) devmon.cfg is looking at /home/xymon/server/etc/hosts.cfg #grep DEVMON /home/xymon/server/etc/hosts.cfg 172.16.0.60 stouderapc # DEVMON:cid(imagineapc) # ./devmon --readbbhosts -f -p -vvvvvvvvvvvvvvvvvvvvvvv [11-05-27 at 12:25:31] Option 'bblocation' defaulting to: [11-05-27 at 12:25:31] SNMP querying all hosts in bb-hosts file, please wait... [11-05-27 at 12:25:31] Checking if # bbd http://localhost.localdomain/matches NET:. [11-05-27 at 12:25:31] Checking if # DEVMON matches NET:. [11-05-27 at 12:25:31] Option 'bbdateformat' defaulting to: . [11-05-27 at 12:25:31] Option 'dispport' defaulting to: 1984. [11-05-27 at 12:25:31] Querying pre-existing hosts [11-05-27 at 12:25:31] Discovered stouderapc as a apc 9619 [11-05-27 at 12:25:31] Received signal TERM, shutting down with return code 0 [11-05-27 at 12:25:32] Received signal TERM, shutting down with return code 0 ./devmon --readbbhosts #log shows [11-05-27 at 12:14:57] Nodename autodetected as localhost.localdomain [11-05-27 at 12:14:57] Option 'bbdateformat' defaulting to: . [11-05-27 at 12:14:57] Option 'dispport' defaulting to: 1984. [11-05-27 at 12:14:57] ---Initilizing devmon... [11-05-27 at 12:14:57] Verbosity level: 30 [11-05-27 at 12:14:57] Logging to /var/log/devmon.log [11-05-27 at 12:14:57] Node 0 reporting to localhost [11-05-27 at 12:14:57] Running under process id: 2361 [11-05-27 at 12:14:57] Entering poll loop [11-05-27 at 12:14:57] Starting snmp queries [11-05-27 at 12:14:57] Getting device status from hobbit at localhost:1984 [11-05-27 at 12:14:57] Performing test logic [11-05-27 at 12:14:57] Done with test logic [11-05-27 at 12:14:57] Sending messages to display server [11-05-27 at 12:14:57] Sleeping for 60 seconds. [11-05-27 at 12:15:13] Received signal INT, shutting down with return code 0 dm in Xymonreads: devmon, version 0.3.1-beta1 Node name: localhost.localdomain Node number: 0 Process ID: 28488 Cycle time: 60 Dead time: 180 Polled devices: Polled tests: Avg tests/node: n/a # clear msgs: 0 SNMP test time: 0 Test logic time: 0 BB msg xfer time: 0 This poll period: 0 Avg poll time: 0.2 seconds Poll time averaged over 5 poll cycles. Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX
list Josh Luthman
Just an update to this, I noticed Devmon is no longer reporting to Xymon (dm test is purple). # ./devmon --readbbhosts -vvvvvvvv --debug [11-05-27 at 13:13:03] Option 'bblocation' defaulting to: [11-05-27 at 13:13:03] DEBUG TEMPLATES: running read_templates() [11-05-27 at 13:13:03] DEBUG TEMPLATES: read apc:9617:power template [11-05-27 at 13:13:03] DEBUG TEMPLATES: read apc:9619:power template [11-05-27 at 13:13:03] DEBUG TEMPLATES: read apc:9619:env template [11-05-27 at 13:13:03] DEBUG TEMPLATES: running post_template_load() [11-05-27 at 13:13:03] Saw 1 vendors, 2 models, 2 sysdescs & 6 templates [11-05-27 at 13:13:03] SNMP querying all hosts in bb-hosts file, please wait... [11-05-27 at 13:13:03] Checking if # bbd http://localhost.localdomain/matches NET:. [11-05-27 at 13:13:03] Checking if # DEVMON:cid(imagineapc) matches NET:. [11-05-27 at 13:13:03] DEBUG CFG: running read_hosts [11-05-27 at 13:13:03] Option 'bbdateformat' defaulting to: . [11-05-27 at 13:13:03] Option 'dispport' defaulting to: 1984. [11-05-27 at 13:13:03] Querying pre-existing hosts [11-05-27 at 13:13:03] DEBUG SNMP: 1 [11-05-27 at 13:13:03] DEBUG SNMP: 0 => 1.3.6.1.2.1.1.1.0 [11-05-27 at 13:13:03] DEBUG SNMP: Adding ID => 1 OID =>1.3.6.1.2.1.1.1.0 [11-05-27 at 13:13:03] DEBUG SNMP: Pooling 1 oids [11-05-27 at 13:13:03] DEBUG SNMP: Dethawing data for stouderapc [11-05-27 at 13:13:03] stouderapc sysdesc = ::: APC Web/SNMP Management Card
▸
(MB:v3.9.2 PF:v3.6.1 PN:apc_hw02_aos_361.bin AF1:v3.5.8
AN1:apc_hw02_sumx_358.bin MN:AP9619 HR:A10 SN: NA0829011474 MD:07/19/2008)
(Embedded PowerNet SNMP Agent SW v2.2 compatible) :::
[11-05-27 at 13:13:03] stouderapc did not match apc : 9617 : MN:AP9617
[11-05-27 at 13:13:03] Discovered stouderapc as a apc 9619
[11-05-27 at 13:13:03] Received signal TERM, shutting down with return code 0
[11-05-27 at 13:13:04] Received signal TERM, shutting down with return code 0
(The last line is repeated 10 times total)
▸
Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX
On Fri, May 27, 2011 at 12:40 PM, Josh Luthman
▸
<user-4c45a83f15cb@xymon.invalid>wrote:
Sorry for the long post, just trying to put all the information I think is relevant in one place! I believe I have Devmon all ready to go short of one example test. I copied the templates from SF and put them in the templates directory. I am trying this with apc-9619. From what I've read, it simply looks to match a string in sysdesc of templates/apc-9619/specs with what comes back from the sysDescr snmp query. This is what I have: # more templates/apc-9619/specs vendor : apc model : 9619 snmpver : 1 sysdesc : *MN:AP9619* # snmpwalk -v1 -ccommunity 172.16.0.60|grep MN\:AP9619 SNMPv2-MIB::sysDescr.0 = STRING: APC Web/SNMP Management Card (MB:v3.9.2 PF:v3.6.1 PN:apc_hw02_aos_361.bin AF1:v3.5.8 AN1:apc_hw02_sumx_358.bin *MN:AP9619 *HR:A10 SN: NA0829011474 MD:07/19/2008) (Embedded PowerNet SNMP Agent SW v2.2 compatible) devmon.cfg is looking at /home/xymon/server/etc/hosts.cfg #grep DEVMON /home/xymon/server/etc/hosts.cfg 172.16.0.60 stouderapc # DEVMON:cid(imagineapc) # ./devmon --readbbhosts -f -p -vvvvvvvvvvvvvvvvvvvvvvv [11-05-27 at 12:25:31] Option 'bblocation' defaulting to: [11-05-27 at 12:25:31] SNMP querying all hosts in bb-hosts file, please wait... [11-05-27 at 12:25:31] Checking if # bbd http://localhost.localdomain/matches NET:. [11-05-27 at 12:25:31] Checking if # DEVMON matches NET:. [11-05-27 at 12:25:31] Option 'bbdateformat' defaulting to: . [11-05-27 at 12:25:31] Option 'dispport' defaulting to: 1984. [11-05-27 at 12:25:31] Querying pre-existing hosts [11-05-27 at 12:25:31] Discovered stouderapc as a apc 9619 [11-05-27 at 12:25:31] Received signal TERM, shutting down with return code 0 [11-05-27 at 12:25:32] Received signal TERM, shutting down with return code 0 ./devmon --readbbhosts #log shows [11-05-27 at 12:14:57] Nodename autodetected as localhost.localdomain [11-05-27 at 12:14:57] Option 'bbdateformat' defaulting to: . [11-05-27 at 12:14:57] Option 'dispport' defaulting to: 1984. [11-05-27 at 12:14:57] ---Initilizing devmon... [11-05-27 at 12:14:57] Verbosity level: 30 [11-05-27 at 12:14:57] Logging to /var/log/devmon.log [11-05-27 at 12:14:57] Node 0 reporting to localhost [11-05-27 at 12:14:57] Running under process id: 2361 [11-05-27 at 12:14:57] Entering poll loop [11-05-27 at 12:14:57] Starting snmp queries [11-05-27 at 12:14:57] Getting device status from hobbit at localhost:1984 [11-05-27 at 12:14:57] Performing test logic [11-05-27 at 12:14:57] Done with test logic [11-05-27 at 12:14:57] Sending messages to display server [11-05-27 at 12:14:57] Sleeping for 60 seconds. [11-05-27 at 12:15:13] Received signal INT, shutting down with return code 0 dm in Xymonreads: devmon, version 0.3.1-beta1 Node name: localhost.localdomain Node number: 0 Process ID: 28488 Cycle time: 60 Dead time: 180 Polled devices: Polled tests: Avg tests/node: n/a # clear msgs: 0 SNMP test time: 0 Test logic time: 0 BB msg xfer time: 0 This poll period: 0 Avg poll time: 0.2 seconds Poll time averaged over 5 poll cycles. Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX
list David Baldwin
Josh,
▸
Sorry for the long post, just trying to put all the information I think is relevant in one place! I believe I have Devmon all ready to go short of one example test. I copied the templates from SF and put them in the templates directory. I am trying this with apc-9619. From what I've read, it simply looks to match a string in sysdesc of templates/apc-9619/specs with what comes back from the sysDescr snmp query.
Matching sysDescr is one way to do it, and what you have included below would indicate this is working OK for you. The way to specify the template you want explicitly is to use the tag "DEVMON:model(vendor;model)" where "vendor" and "model" match the lines in the template specs file. From what you've included, looks like the --readbbhosts is working OK. The next step is to actually poll the device to report. What do you get when you run "./devmon -f -p -vvv" ? David.
▸
This is what I have: # more templates/apc-9619/specs vendor : apc model : 9619 snmpver : 1 sysdesc : *MN:AP9619* # snmpwalk -v1 -ccommunity 172.16.0.60|grep MN\:AP9619 SNMPv2-MIB::sysDescr.0 = STRING: APC Web/SNMP Management Card (MB:v3.9.2 PF:v3.6.1 PN:apc_hw02_aos_361.bin AF1:v3.5.8 AN1:apc_hw02_sumx_358.bin *MN:AP9619 *HR:A10 SN: NA0829011474 MD:07/19/2008) (Embedded PowerNet SNMP Agent SW v2.2 compatible) devmon.cfg is looking at /home/xymon/server/etc/hosts.cfg #grep DEVMON /home/xymon/server/etc/hosts.cfg 172.16.0.60 stouderapc # DEVMON:cid(imagineapc) # ./devmon --readbbhosts -f -p -vvvvvvvvvvvvvvvvvvvvvvv [11-05-27 at 12:25:31] Option 'bblocation' defaulting to: [11-05-27 at 12:25:31] SNMP querying all hosts in bb-hosts file, please wait... [11-05-27 at 12:25:31] Checking if # bbd
http://localhost.localdomain/ matches NET:.
▸
[11-05-27 at 12:25:31] Checking if # DEVMON matches NET:.
[11-05-27 at 12:25:31] Option 'bbdateformat' defaulting to: .
[11-05-27 at 12:25:31] Option 'dispport' defaulting to: 1984.
[11-05-27 at 12:25:31] Querying pre-existing hosts
[11-05-27 at 12:25:31] Discovered stouderapc as a apc 9619
[11-05-27 at 12:25:31] Received signal TERM, shutting down with return code 0
[11-05-27 at 12:25:32] Received signal TERM, shutting down with return code 0
./devmon --readbbhosts
#log shows
[11-05-27 at 12:14:57] Nodename autodetected as localhost.localdomain
[11-05-27 at 12:14:57] Option 'bbdateformat' defaulting to: .
[11-05-27 at 12:14:57] Option 'dispport' defaulting to: 1984.
[11-05-27 at 12:14:57] ---Initilizing devmon...
[11-05-27 at 12:14:57] Verbosity level: 30
[11-05-27 at 12:14:57] Logging to /var/log/devmon.log
[11-05-27 at 12:14:57] Node 0 reporting to localhost
[11-05-27 at 12:14:57] Running under process id: 2361
[11-05-27 at 12:14:57] Entering poll loop
[11-05-27 at 12:14:57] Starting snmp queries
[11-05-27 at 12:14:57] Getting device status from hobbit at localhost:1984
[11-05-27 at 12:14:57] Performing test logic
[11-05-27 at 12:14:57] Done with test logic
[11-05-27 at 12:14:57] Sending messages to display server
[11-05-27 at 12:14:57] Sleeping for 60 seconds.
[11-05-27 at 12:15:13] Received signal INT, shutting down with return code 0
dm in Xymonreads:
devmon, version 0.3.1-beta1
Node name: localhost.localdomain
Node number: 0
Process ID: 28488
Cycle time: 60
Dead time: 180
Polled devices:
Polled tests:
Avg tests/node: n/a
# clear msgs: 0
SNMP test time: 0
Test logic time: 0
BB msg xfer time: 0
This poll period: 0
Avg poll time: 0.2 seconds
Poll time averaged over 5 poll cycles.
Josh Luthman
Office: XXX-XXX-XXXX <tel:XXX-XXX-XXXX>
Direct: XXX-XXX-XXXX <tel:XXX-XXX-XXXX>
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX-- David Baldwin - IT Unit Australian Sports Commission www.ausport.gov.au Tel 02 62147830 Fax 02 62141830 PO Box 176 Belconnen ACT 2616 user-cbbf693f2c89@xymon.invalid Leverrier Street Bruce ACT 2617 Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
list Buchan Milne
▸
On Friday, 27 May 2011 19:13:46 Josh Luthman wrote:
Just an update to this, I noticed Devmon is no longer reporting to Xymon (dm test is purple).
Note that there is a mailing list for devmon. Since your mail doesn't contain anything related to Xymon, the devmon list would have been more appropriate. Did you actually start devmon?
# ./devmon --readbbhosts -vvvvvvvv --debug
Note that devmon --readbbhosts does a one-shot detect-and-write run. It does not run in "normal" polling mode.
▸
[11-05-27 at 13:13:03] Option 'bblocation' defaulting to: [11-05-27 at 13:13:03] DEBUG TEMPLATES: running read_templates() [11-05-27 at 13:13:03] DEBUG TEMPLATES: read apc:9617:power template [11-05-27 at 13:13:03] DEBUG TEMPLATES: read apc:9619:power template [11-05-27 at 13:13:03] DEBUG TEMPLATES: read apc:9619:env template [11-05-27 at 13:13:03] DEBUG TEMPLATES: running post_template_load() [11-05-27 at 13:13:03] Saw 1 vendors, 2 models, 2 sysdescs & 6 templates [11-05-27 at 13:13:03] SNMP querying all hosts in bb-hosts file, please wait... [11-05-27 at 13:13:03] Checking if # bbd http://localhost.localdomain/matches NET:. [11-05-27 at 13:13:03] Checking if # DEVMON:cid(imagineapc) matches NET:. [11-05-27 at 13:13:03] DEBUG CFG: running read_hosts [11-05-27 at 13:13:03] Option 'bbdateformat' defaulting to: . [11-05-27 at 13:13:03] Option 'dispport' defaulting to: 1984. [11-05-27 at 13:13:03] Querying pre-existing hosts [11-05-27 at 13:13:03] DEBUG SNMP: 1 [11-05-27 at 13:13:03] DEBUG SNMP: 0 => 1.3.6.1.2.1.1.1.0 [11-05-27 at 13:13:03] DEBUG SNMP: Adding ID => 1 OID =>1.3.6.1.2.1.1.1.0 [11-05-27 at 13:13:03] DEBUG SNMP: Pooling 1 oids [11-05-27 at 13:13:03] DEBUG SNMP: Dethawing data for stouderapc [11-05-27 at 13:13:03] stouderapc sysdesc = ::: APC Web/SNMP Management Card (MB:v3.9.2 PF:v3.6.1 PN:apc_hw02_aos_361.bin AF1:v3.5.8 AN1:apc_hw02_sumx_358.bin MN:AP9619 HR:A10 SN: NA0829011474 MD:07/19/2008) (Embedded PowerNet SNMP Agent SW v2.2 compatible) ::: [11-05-27 at 13:13:03] stouderapc did not match apc : 9617 : MN:AP9617 [11-05-27 at 13:13:03] Discovered stouderapc as a apc 9619
So all is good. You just need to start devmon. Note that this message was present in your previous post too.
▸
[11-05-27 at 13:13:03] Received signal TERM, shutting down with return code 0 [11-05-27 at 13:13:04] Received signal TERM, shutting down with return code 0 (The last line is repeated 10 times total)
I think I have cleaned that (and a few other annoyances in --readbbhosts mode) up in svn. Regards, Buchan
list Josh Luthman
Thanks for the reply, David! I waited ~5 minutes and refreshed the bb.html page - the dm column isn't showing up. I tried accessing it via URL and the data is still blank (Status not available). # ./devmon -f -p -vvv [11-05-30 at 13:43:18] Option 'bblocation' defaulting to: [11-05-30 at 13:43:18] Nodename autodetected as localhost.localdomain [11-05-30 at 13:43:18] Option 'bbdateformat' defaulting to: . [11-05-30 at 13:43:18] Option 'dispport' defaulting to: 1984. [11-05-30 at 13:43:18] Option 'dispserv' defaulting to: localhost. [11-05-30 at 13:43:18] ---Initilizing devmon... [11-05-30 at 13:43:18] Verbosity level: 3 [11-05-30 at 13:43:18] Logging to /var/log/devmon.log [11-05-30 at 13:43:18] Node 0 reporting to localhost [11-05-30 at 13:43:18] Running under process id: 24542 [11-05-30 at 13:43:18] Entering poll loop [11-05-30 at 13:43:18] Starting snmp queries [11-05-30 at 13:43:18] Getting device status from hobbit at localhost:1984 [11-05-30 at 13:43:19] Performing test logic [11-05-30 at 13:43:19] Done with test logic [11-05-30 at 13:43:19] Sending messages to display server status stouderapc.power green Mon May 30 13:43:19 2011 UPS status: Vendor: apc Model: Smart-UPS 2200 RM XL UPS Status: Online Battery Status: Battery OK Runtime Remaining: 29.00 minutes (red=<15m) Battery Capacity: 100% UPS Load: 50% (yellow=70% red=90%) Voltage in: 121v (yellow=>127,<110v red=135v) Voltage out: 121v Last failure due to: Self test Time on battery: 0.00 secs Devmon version 0.3.1-beta1 running on localhost.localdomain status localhost,localdomain.dm green Mon May 30 13:43:19 2011 devmon, version 0.3.1-beta1 Node name: localhost.localdomain Node number: 0 Process ID: 24542 Cycle time: 60 Dead time: 180 Polled devices: 1 Polled tests: 1 Avg tests/node: n/a # clear msgs: 0 SNMP test time: 1 Test logic time: 0 BB msg xfer time: 0 This poll period: 1 Avg poll time: wait [11-05-30 at 13:43:19] Sleeping for 59 seconds.
▸
Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX
On Mon, May 30, 2011 at 2:30 AM, David Baldwin <user-cbbf693f2c89@xymon.invalid▸
wrote:
Josh, Sorry for the long post, just trying to put all the information I think is relevant in one place! I believe I have Devmon all ready to go short of one example test. I copied the templates from SF and put them in the templates directory. I am trying this with apc-9619. From what I've read, it simply looks to match a string in sysdesc of templates/apc-9619/specs with what comes back from the sysDescr snmp query. Matching sysDescr is one way to do it, and what you have included below would indicate this is working OK for you. The way to specify the template you want explicitly is to use the tag "DEVMON:model(vendor;model)" where "vendor" and "model" match the lines in the template specs file. From what you've included, looks like the --readbbhosts is working OK. The next step is to actually poll the device to report. What do you get when you run "./devmon -f -p -vvv" ? David. This is what I have: # more templates/apc-9619/specs vendor : apc model : 9619 snmpver : 1 sysdesc : *MN:AP9619* # snmpwalk -v1 -ccommunity 172.16.0.60|grep MN\:AP9619 SNMPv2-MIB::sysDescr.0 = STRING: APC Web/SNMP Management Card (MB:v3.9.2 PF:v3.6.1 PN:apc_hw02_aos_361.bin AF1:v3.5.8 AN1:apc_hw02_sumx_358.bin *MN:AP9619 *HR:A10 SN: NA0829011474 MD:07/19/2008) (Embedded PowerNet SNMP Agent SW v2.2 compatible) devmon.cfg is looking at /home/xymon/server/etc/hosts.cfg #grep DEVMON /home/xymon/server/etc/hosts.cfg 172.16.0.60 stouderapc # DEVMON:cid(imagineapc) # ./devmon --readbbhosts -f -p -vvvvvvvvvvvvvvvvvvvvvvv [11-05-27 at 12:25:31] Option 'bblocation' defaulting to: [11-05-27 at 12:25:31] SNMP querying all hosts in bb-hosts file, please wait... [11-05-27 at 12:25:31] Checking if # bbd http://localhost.localdomain/matches NET:. [11-05-27 at 12:25:31] Checking if # DEVMON matches NET:. [11-05-27 at 12:25:31] Option 'bbdateformat' defaulting to: . [11-05-27 at 12:25:31] Option 'dispport' defaulting to: 1984. [11-05-27 at 12:25:31] Querying pre-existing hosts [11-05-27 at 12:25:31] Discovered stouderapc as a apc 9619 [11-05-27 at 12:25:31] Received signal TERM, shutting down with return code 0 [11-05-27 at 12:25:32] Received signal TERM, shutting down with return code 0 ./devmon --readbbhosts #log shows [11-05-27 at 12:14:57] Nodename autodetected as localhost.localdomain [11-05-27 at 12:14:57] Option 'bbdateformat' defaulting to: . [11-05-27 at 12:14:57] Option 'dispport' defaulting to: 1984. [11-05-27 at 12:14:57] ---Initilizing devmon... [11-05-27 at 12:14:57] Verbosity level: 30 [11-05-27 at 12:14:57] Logging to /var/log/devmon.log [11-05-27 at 12:14:57] Node 0 reporting to localhost [11-05-27 at 12:14:57] Running under process id: 2361 [11-05-27 at 12:14:57] Entering poll loop [11-05-27 at 12:14:57] Starting snmp queries [11-05-27 at 12:14:57] Getting device status from hobbit at localhost:1984 [11-05-27 at 12:14:57] Performing test logic [11-05-27 at 12:14:57] Done with test logic [11-05-27 at 12:14:57] Sending messages to display server [11-05-27 at 12:14:57] Sleeping for 60 seconds. [11-05-27 at 12:15:13] Received signal INT, shutting down with return code 0 dm in Xymonreads: devmon, version 0.3.1-beta1 Node name: localhost.localdomain Node number: 0 Process ID: 28488 Cycle time: 60 Dead time: 180 Polled devices: Polled tests: Avg tests/node: n/a # clear msgs: 0 SNMP test time: 0 Test logic time: 0 BB msg xfer time: 0 This poll period: 0 Avg poll time: 0.2 seconds Poll time averaged over 5 poll cycles. Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX -- David Baldwin - IT Unit Australian Sports Commission www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830 PO Box 176 Belconnen ACT user-0e3dcac72dc1@xymon.invalid Leverrier Street Bruce ACT 2617
Keep up to date with what's happening in Australian sport visit
www.ausport.gov.au
▸
This message is intended for the addressee named and may contain
confidential and privileged information. If you are not the intended
recipient please note that any form of distribution, copying or use of this
communication or the information in it is strictly prohibited and may be
unlawful. If you receive this message in error, please delete it and notify
the sender.
list Josh Luthman
I have no idea what would have changed, but it started working. This morning I had no devmon ps, ran the debug options David suggested and started Devmon up again (./devmon). It seems to have been updating for the last 5 hours.
▸
Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX
On Mon, May 30, 2011 at 1:45 PM, Josh Luthman
▸
<user-4c45a83f15cb@xymon.invalid>wrote:
Thanks for the reply, David! I waited ~5 minutes and refreshed the bb.html page - the dm column isn't showing up. I tried accessing it via URL and the data is still blank (Status not available). # ./devmon -f -p -vvv [11-05-30 at 13:43:18] Option 'bblocation' defaulting to: [11-05-30 at 13:43:18] Nodename autodetected as localhost.localdomain [11-05-30 at 13:43:18] Option 'bbdateformat' defaulting to: . [11-05-30 at 13:43:18] Option 'dispport' defaulting to: 1984. [11-05-30 at 13:43:18] Option 'dispserv' defaulting to: localhost. [11-05-30 at 13:43:18] ---Initilizing devmon... [11-05-30 at 13:43:18] Verbosity level: 3 [11-05-30 at 13:43:18] Logging to /var/log/devmon.log [11-05-30 at 13:43:18] Node 0 reporting to localhost [11-05-30 at 13:43:18] Running under process id: 24542 [11-05-30 at 13:43:18] Entering poll loop [11-05-30 at 13:43:18] Starting snmp queries [11-05-30 at 13:43:18] Getting device status from hobbit at localhost:1984 [11-05-30 at 13:43:19] Performing test logic [11-05-30 at 13:43:19] Done with test logic [11-05-30 at 13:43:19] Sending messages to display server status stouderapc.power green Mon May 30 13:43:19 2011 UPS status: Vendor: apc Model: Smart-UPS 2200 RM XL UPS Status: Online Battery Status: Battery OK Runtime Remaining: 29.00 minutes (red=<15m) Battery Capacity: 100% UPS Load: 50% (yellow=70% red=90%) Voltage in: 121v (yellow=>127,<110v red=135v) Voltage out: 121v Last failure due to: Self test Time on battery: 0.00 secs Devmon version 0.3.1-beta1 running on localhost.localdomain status localhost,localdomain.dm green Mon May 30 13:43:19 2011 devmon, version 0.3.1-beta1 Node name: localhost.localdomain Node number: 0 Process ID: 24542 Cycle time: 60 Dead time: 180 Polled devices: 1 Polled tests: 1 Avg tests/node: n/a # clear msgs: 0 SNMP test time: 1 Test logic time: 0 BB msg xfer time: 0 This poll period: 1 Avg poll time: wait [11-05-30 at 13:43:19] Sleeping for 59 seconds. Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX On Mon, May 30, 2011 at 2:30 AM, David Baldwin < user-cbbf693f2c89@xymon.invalid> wrote:Josh, Sorry for the long post, just trying to put all the information I think is relevant in one place! I believe I have Devmon all ready to go short of one example test. I copied the templates from SF and put them in the templates directory. I am trying this with apc-9619. From what I've read, it simply looks to match a string in sysdesc of templates/apc-9619/specs with what comes back from the sysDescr snmp query. Matching sysDescr is one way to do it, and what you have included below would indicate this is working OK for you. The way to specify the template you want explicitly is to use the tag "DEVMON:model(vendor;model)" where "vendor" and "model" match the lines in the template specs file. From what you've included, looks like the --readbbhosts is working OK. The next step is to actually poll the device to report. What do you get when you run "./devmon -f -p -vvv" ? David. This is what I have: # more templates/apc-9619/specs vendor : apc model : 9619 snmpver : 1 sysdesc : *MN:AP9619* # snmpwalk -v1 -ccommunity 172.16.0.60|grep MN\:AP9619 SNMPv2-MIB::sysDescr.0 = STRING: APC Web/SNMP Management Card (MB:v3.9.2 PF:v3.6.1 PN:apc_hw02_aos_361.bin AF1:v3.5.8 AN1:apc_hw02_sumx_358.bin *MN:AP9619 *HR:A10 SN: NA0829011474 MD:07/19/2008) (Embedded PowerNet SNMP Agent SW v2.2 compatible) devmon.cfg is looking at /home/xymon/server/etc/hosts.cfg #grep DEVMON /home/xymon/server/etc/hosts.cfg 172.16.0.60 stouderapc # DEVMON:cid(imagineapc) # ./devmon --readbbhosts -f -p -vvvvvvvvvvvvvvvvvvvvvvv [11-05-27 at 12:25:31] Option 'bblocation' defaulting to: [11-05-27 at 12:25:31] SNMP querying all hosts in bb-hosts file, please wait... [11-05-27 at 12:25:31] Checking if # bbd http://localhost.localdomain/matches NET:. [11-05-27 at 12:25:31] Checking if # DEVMON matches NET:. [11-05-27 at 12:25:31] Option 'bbdateformat' defaulting to: . [11-05-27 at 12:25:31] Option 'dispport' defaulting to: 1984. [11-05-27 at 12:25:31] Querying pre-existing hosts [11-05-27 at 12:25:31] Discovered stouderapc as a apc 9619 [11-05-27 at 12:25:31] Received signal TERM, shutting down with return code 0 [11-05-27 at 12:25:32] Received signal TERM, shutting down with return code 0 ./devmon --readbbhosts #log shows [11-05-27 at 12:14:57] Nodename autodetected as localhost.localdomain [11-05-27 at 12:14:57] Option 'bbdateformat' defaulting to: . [11-05-27 at 12:14:57] Option 'dispport' defaulting to: 1984. [11-05-27 at 12:14:57] ---Initilizing devmon... [11-05-27 at 12:14:57] Verbosity level: 30 [11-05-27 at 12:14:57] Logging to /var/log/devmon.log [11-05-27 at 12:14:57] Node 0 reporting to localhost [11-05-27 at 12:14:57] Running under process id: 2361 [11-05-27 at 12:14:57] Entering poll loop [11-05-27 at 12:14:57] Starting snmp queries [11-05-27 at 12:14:57] Getting device status from hobbit at localhost:1984 [11-05-27 at 12:14:57] Performing test logic [11-05-27 at 12:14:57] Done with test logic [11-05-27 at 12:14:57] Sending messages to display server [11-05-27 at 12:14:57] Sleeping for 60 seconds. [11-05-27 at 12:15:13] Received signal INT, shutting down with return code 0 dm in Xymonreads: devmon, version 0.3.1-beta1 Node name: localhost.localdomain Node number: 0 Process ID: 28488 Cycle time: 60 Dead time: 180 Polled devices: Polled tests: Avg tests/node: n/a # clear msgs: 0 SNMP test time: 0 Test logic time: 0 BB msg xfer time: 0 This poll period: 0 Avg poll time: 0.2 seconds Poll time averaged over 5 poll cycles. Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX -- David Baldwin - IT Unit Australian Sports Commission www.ausport.gov.au Tel 02 62147830 Fax 02 62141830 PO Box 176 Belconnen ACT user-0e3dcac72dc1@xymon.invalid Leverrier Street Bruce ACT 2617 Keep up to date with what's happening in Australian sport visit www.ausport.gov.au This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
list Ken Connell
I've had issues with devmon not updating the bb-display and everything going purple. I've had this issue since day one (which is over two years now). I created a "devmon watchdog" script that's runs every 5 min using lynx (txt base html browser) which checks if the status of devmon (shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick. I no script expert, but can share the bash script if you want/need. Ken Connell Intermediate Network Engineer Computer & Communication Services Ryerson University XXX Victoria St RM AB50 Toronto, Ont M5B 2K3 XXX-XXX-XXXX x6709 -----Original Message----- From: Josh Luthman <user-4c45a83f15cb@xymon.invalid> Sender: xymon-bounces at xymon.com Date: Mon, 30 May 2011 19:06:21 To: David Baldwin<user-cbbf693f2c89@xymon.invalid> Cc: xymon at xymon.com<xymon at xymon.com> Subject: Re: [Xymon] Configuring Devmon for the first time
list Josh Luthman
That sounds really straight forward, but if you've done the work already I would hate to waste my time recreating the wheel. Please do share, if you wouldn't mind =)
▸
Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX
▸
On Mon, May 30, 2011 at 9:24 PM, <user-7cb0f5662626@xymon.invalid> wrote:
I've had issues with devmon not updating the bb-display and everything going purple. I've had this issue since day one (which is over two years now). I created a "devmon watchdog" script that's runs every 5 min using lynx (txt base html browser) which checks if the status of devmon (shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick. I no script expert, but can share the bash script if you want/need. Ken Connell Intermediate Network Engineer Computer & Communication Services Ryerson University XXX Victoria St RM AB50 Toronto, Ont M5B 2K3 XXX-XXX-XXXX x6709 -----Original Message----- From: Josh Luthman <user-4c45a83f15cb@xymon.invalid> Sender: xymon-bounces at xymon.com Date: Mon, 30 May 2011 19:06:21 To: David Baldwin<user-cbbf693f2c89@xymon.invalid> Cc: xymon at xymon.com<xymon at xymon.com> Subject: Re: [Xymon] Configuring Devmon for the first time
list David Baldwin
▸
On 31/05/11 11:24 AM, user-7cb0f5662626@xymon.invalid wrote:
I've had issues with devmon not updating the bb-display and everything going purple. I've had this issue since day one (which is over two years now). I created a "devmon watchdog" script that's runs every 5 min using lynx (txt base html browser) which checks if the status of devmon (shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick. I no script expert, but can share the bash script if you want/need.
Here's mine (replace xymonserver with your hostname): #!/bin/sh COL=`bb xymonserver "hobbitdboard xymonserver.dm fields=color"` if [ "x$COL" == "xpurple" ] ; then (date "+%x %X restarting purple devmon" /etc/init.d/devmon restart) | tee /var/log/devmon-restart.log | mail -s "Restarting devmon" xymonadmin fi
▸
-- David Baldwin - IT Unit Australian Sports Commission www.ausport.gov.au Tel 02 62147830 Fax 02 62141830 PO Box 176 Belconnen ACT 2616 user-cbbf693f2c89@xymon.invalid Leverrier Street Bruce ACT 2617 Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
list Josh Luthman
That probably makes more sense then to use Lynx, good idea. What's with the "x" in the variable? Would you mind telling me what values you used for date?
▸
Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX
On Tue, May 31, 2011 at 12:53 AM, David Baldwin <
▸
user-cbbf693f2c89@xymon.invalid> wrote:
On 31/05/11 11:24 AM, user-7cb0f5662626@xymon.invalid wrote:I've had issues with devmon not updating the bb-display and everything going purple. I've had this issue since day one (which is over two years now). I created a "devmon watchdog" script that's runs every 5 min using lynx(txt base html browser) which checks if the status of devmon (shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick.I no script expert, but can share the bash script if you want/need.Here's mine (replace xymonserver with your hostname): #!/bin/sh COL=`bb xymonserver "hobbitdboard xymonserver.dm fields=color"` if [ "x$COL" == "xpurple" ] ; then (date "+%x %X restarting purple devmon" /etc/init.d/devmon restart) | tee /var/log/devmon-restart.log | mail -s "Restarting devmon" xymonadmin fi -- David Baldwin - IT Unit Australian Sports Commission www.ausport.gov.au Tel 02 62147830 Fax 02 62141830 PO Box 176 Belconnen ACT 2616 user-cbbf693f2c89@xymon.invalid Leverrier Street Bruce ACT 2617 Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
list David Baldwin
Josh,
▸
That probably makes more sense then to use Lynx, good idea. What's with the "x" in the variable?
If for some reason $COL is the null string, the test doesn't work. Add an "x" in front to be sure.
Would you mind telling me what values you used for date?
It's just adding a timestamp to the log file. See "man date" $ date "+%x %X restarting purple devmon" 31/05/2011 16:16:04 restarting purple devmon David.
▸
Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX On Tue, May 31, 2011 at 12:53 AM, David Baldwin
<user-cbbf693f2c89@xymon.invalid <mailto:user-cbbf693f2c89@xymon.invalid>>
▸
wrote: On 31/05/11 11:24 AM, user-7cb0f5662626@xymon.invalid <mailto:user-7cb0f5662626@xymon.invalid> wrote:I've had issues with devmon not updating the bb-display and everything going purple. I've had this issue since day one (which is over two years now). I created a "devmon watchdog" script that's runs every 5 min using lynx (txt base html browser) which checks if the status of devmon (shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick. I no script expert, but can share the bash script if you want/need.Here's mine (replace xymonserver with your hostname): #!/bin/sh COL=`bb xymonserver "hobbitdboard xymonserver.dm
<http://xymonserver.dm>; fields=color"`
▸
if [ "x$COL" == "xpurple" ] ; then
(date "+%x %X restarting purple devmon"
/etc/init.d/devmon restart) | tee /var/log/devmon-restart.log | mail
-s "Restarting devmon" xymonadmin
fi
--
David Baldwin - IT Unit
Australian Sports Commission www.ausport.gov.au<http://www.ausport.gov.au>; Tel 02 62147830 Fax 02 62141830 PO Box 176 Belconnen ACT 2616 user-cbbf693f2c89@xymon.invalid <mailto:user-cbbf693f2c89@xymon.invalid>
▸
Leverrier Street Bruce ACT 2617 Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
-- David Baldwin - IT Unit Australian Sports Commission www.ausport.gov.au Tel 02 62147830 Fax 02 62141830 PO Box 176 Belconnen ACT 2616 user-cbbf693f2c89@xymon.invalid Leverrier Street Bruce ACT 2617
list Ryan Novosielski
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The X is a trick that deals with empty variables, and I suppose keeps some interpreters from complaining about doing a test on a blank variable. I've seen this done frequently enough to know that people do it, but I agree, it looks a little odd and I'm not sure I'd write a program that way myself. This is off topic, but I'd love to know if anyone has any comments on that particular thing. Shortcut to avoid needing to check for empty variables I guess?
▸
On 05/31/2011 12:57 AM, Josh Luthman wrote:That probably makes more sense then to use Lynx, good idea. What's with the "x" in the variable? Would you mind telling me what values you used for date? Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX On Tue, May 31, 2011 at 12:53 AM, David Baldwin <user-cbbf693f2c89@xymon.invalid <mailto:user-cbbf693f2c89@xymon.invalid>> wrote: On 31/05/11 11:24 AM, user-7cb0f5662626@xymon.invalid <mailto:user-7cb0f5662626@xymon.invalid> wrote:I've had issues with devmon not updating the bb-display and everything going purple. I've had this issue since day one (which is over two years now). I created a "devmon watchdog" script that's runs every 5 min using lynx (txt base html browser) which checks if the status of devmon(shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick.I no script expert, but can share the bash script if you want/need.Here's mine (replace xymonserver with your hostname): #!/bin/sh COL=`bb xymonserver "hobbitdboard xymonserver.dm <http://xymonserver.dm>; fields=color"` if [ "x$COL" == "xpurple" ] ; then (date "+%x %X restarting purple devmon" /etc/init.d/devmon restart) | tee /var/log/devmon-restart.log | mail -s "Restarting devmon" xymonadmin fi
- -- - ---- _ _ _ _ ___ _ _ _
|Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Sr. Systems Programmer |$&| |__| | | |__/ | \| _| |user-ae4522577e16@xymon.invalid - 973/972.0922 (2-0922) \__/ Univ. of Med. and Dent.|IST/CST-Academic Svcs. - ADMC 450, Newark -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk3kiUMACgkQmb+gadEcsb5yCwCg2I2+K79zvEHjbvpVrPyEf3vg XTgAoIdr0SfWmctf+B41YHb1y6XMXJz7 =o/i3 -----END PGP SIGNATURE-----
list Ken Connell
David's devmon watch-dog is much better than mine but I thought I'd share anyways....
I think if I wrote one today, it would be a little different. This was done a few years back and I kinda chuckled at my own work...I made a var for date....lol
Anyways, here you go...
#!/bin/bash
# Need Date var for log entry
DATE=`date`
# Grab xymon.ns/xymon web page and check if devom is dead (purple)
# Make var to check on purple
DMSTATUS=`lynx -accept_all_cookies -dump -nolist -auth=ns:canne 'xymon/Xymon' | grep dm | tail -1 |grep -o "dm:green\|dm:purple" | cut -c 4-`
echo Status=$DMSTATUS
if [ $DMSTATUS = purple ] ; then
echo "devmon is dead, killing, restarting and logging event"
echo "$DATE DM-Watchdog - devmon is dead ($DMSTATUS), killing and restarting" >> /var/log/devmon.log
# Kill it twice (sometimes 1 don't work ???)
/home/xymon/devmon/killdevmon
sleep 1
/home/xymon/devmon/killdevmon
# Start DEVMON
/home/xymon/devmon/devmon
# Send Email
/usr/local/bin/sendEmail -f user-5d5d55da9ccc@xymon.invalid -t user-7cb0f5662626@xymon.invalid -u Devmon Restart -m "Devmon Died and was restarted on $DATE"
else
#echo "All Good"
echo "$DATE DM-Watchdog - Devmon is All Good ($DMSTATUS)" >> /var/log/devmon.log
fi
▸
Ken Connell
Intermediate Network Engineer
Computer & Communication Services
Ryerson University
XXX Victoria St
RM AB50
Toronto, Ont
M5B 2K3
XXX-XXX-XXXX x6709
----- Original Message -----
From: David Baldwin <user-cbbf693f2c89@xymon.invalid>
Date: Monday, May 30, 2011 11:53 pm
Subject: Re: [Xymon] Configuring Devmon for the first time
To: "user-7cb0f5662626@xymon.invalid" <user-7cb0f5662626@xymon.invalid>
Cc: Josh Luthman <user-4c45a83f15cb@xymon.invalid>, "xymon at xymon.com" <xymon at xymon.com>
On 31/05/11 11:24 AM, user-7cb0f5662626@xymon.invalid wrote:I've had issues with devmon not updating the bb-display and everything going purple. > I've had this issue since day one (which is over two years now). > I created a "devmon watchdog" script that's runs every 5 min using lynx (txt base html browser) which checks if the status of devmon (shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick. > I no script expert, but can share the bash script if you want/need.Here's mine (replace xymonserver with your hostname): #!/bin/sh COL=`bb xymonserver "hobbitdboard xymonserver.dm fields=color"` if [ "x$COL" == "xpurple" ] ; then (date "+%x %X restarting purple devmon" /etc/init.d/devmon restart) | tee /var/log/devmon-restart.log | mail -s "Restarting devmon" xymonadmin fi -- David Baldwin - IT Unit Australian Sports Commission www.ausport.gov.au Tel 02 62147830 Fax 02 62141830 PO Box 176 Belconnen ACT 2616 user-cbbf693f2c89@xymon.invalid Leverrier Street Bruce ACT 2617 Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
list Buchan Milne
▸
On Tuesday, 31 May 2011 03:24:05 user-7cb0f5662626@xymon.invalid wrote:
I've had issues with devmon not updating the bb-display and everything going purple. I've had this issue since day one (which is over two years now). I created a "devmon watchdog" script that's runs every 5 min using lynx (txt base html browser) which checks if the status of devmon (shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick. I no script expert, but can share the bash script if you want/need.
I have made a lot of changes to the version in svn, and they have resolved the majority of the problems I have had with devmon. There has been one additional problem in one environment, but I can't pinpoint it as a bug in devmon (it looks like a bug in perl). However, though I have asked on the devmon mailing list for others to test, I have had *no* other feedback on the changes made since January. I am reluctant to release it as 0.3.1 final without any other feedback. Regards, Buchan
list Buchan Milne
▸
On Tuesday, 31 May 2011 03:24:05 user-7cb0f5662626@xymon.invalid wrote:
I've had issues with devmon not updating the bb-display and everything going purple.
Firstly, I don't think this is Josh's problem, as he didn't have a devmon process, whereas this behaviour is typically that devmon hangs (but the process is still running). If you have different behaviour to the I discuss below, please log a new tracker item. The 'hang' issue is covered in this tracker item: http://sourceforge.net/tracker/?func=detail&aid=2897345&group_id=160720&atid=816977 (Unfortunately, it was logged anonymously, and I have had no feedback on improvements in devmon svn for this issue, either via the tracker, or the mails on the mailing list) Discussion of the issue also occurred on the devmon-support mailing list: http://sourceforge.net/mailarchive/forum.php?thread_name=user-13d284bbdc54@xymon.invalid&forum_name=devmon- support The status has not changed, my failure logs still die at: [11-05-05 at 15:54:02] DEBUG: Printing single combo message size 13390 [11-05-05 at 15:54:02] DEBUG: Finished printing single combo message [11-05-05 at 15:55:42] Fork 3 timed out waiting for data from parent: Timeout at /usr/share/devmon/modules/dm_snmp.pm line 516, <$__ANONIO__> line 30203. The printing code is wrapped in an eval'd alarm subroutine which should return within 10 seconds, and log that the printing had completed or that it had timed out. Instead, the fork has noticed that it hasn't seen anything from the 'master' process within the poll period for some time 40s later. The question is, what should be done in this case? Should the forks attempt to kill the master devmon process? Anyway, I would be grateful if someone could reproduce this on a different platform. I currently see this on RHEL5 x86_64 with perl-5.8.8-27.el5. Other environments have been green since 25 Jan ( since they were upgraded to rev 214: http://devmon.svn.sourceforge.net/viewvc/devmon?view=revision&revision=214).
▸
I created a "devmon watchdog" script that's runs every 5 min using lynx (txt base html browser) which checks if the status of devmon (shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick. I no script expert, but can share the bash script if you want/need.
Here is mine, but I am *not* going to add it to svn and the next release unless I have had some feedback on the changes to prevent this occurring at all, preferable with the failure logs the script keeps.
I run mine from hobbitlaunch.cfg (the problematic box is still running 4.2.2 for now):
[devmon]
ENVFILE /usr/lib64/hobbit/server/etc/hobbitserver.cfg
CMD /usr/local/bin/restart-devmon-if-purple
INTERVAL 1m
LOGFILE /var/log/hobbit/devmon-restart.log
I have a sudo rule in place to allow the hobbit user to call 'sudo /etc/init.d/devmon stop'
#!/bin/bash
if [ "$BB" == "" ]
then
echo "This script must be run under a Hobbit or Xymon environment" >&2
echo "e.g. by: bbcmd $0" >&2
exit 1
fi
if [ "$BBDISPLAYS" != "" ]
then
BBDISP=${BBDISPLAYS#,*}
fi
COLOR=$($BB $BBDISP "hobbitdboard host=$HOSTNAME test=dm" | cut -d'|' -f3)
if [ "`id -u`" -eq 0 ]
then
DEVMON="/etc/init.d/devmon"
PKILL="pkill"
else
DEVMON="sudo /etc/init.d/devmon"
PKILL="sudo pkill"
fi
if [ "$COLOR" == "purple" ]
then
LOGSAVE=/var/log/devmon/failures/devmon-failure-`date +%Y-%m-%d-%H:%M:
%S`.log
echo "Devmon is purple, saving last 200 lines of log to $LOGSAVE"
tail -n200 /var/log/devmon/devmon.log > $LOGSAVE
$DEVMON stop
NUM=$(pgrep -u devmon|wc -l)
if [ "$NUM" -ne 0 ]
then echo "Devmon failed to stop cleanly, terminating manually"
$PKILL -u devmon
sleep 5
fi
NUM=$(pgrep -u devmon|wc -l)
if [ "$NUM" -ne 0 ]
then echo "Devmon failed to terminate cleanly, killing manually"
$PKILL -9 -u devmon
fi
$DEVMON start
else
[ "$DEBUG" == 1 ] && echo "Devmon isn't purple, it is $COLOR"
fi
Regards,
Buchan
list Josh Luthman
Definitely good to see your effort on Devmon, I thought it had since been a forgotten project. The effort is much appreciated! Hopefully someone that see this problem can come forward and help everyone by testing the SVN!
▸
Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX
▸
On Wed, Jun 1, 2011 at 10:39 AM, Buchan Milne <user-9b139aff4dec@xymon.invalid>wrote:
On Tuesday, 31 May 2011 03:24:05 user-7cb0f5662626@xymon.invalid wrote:I've had issues with devmon not updating the bb-display and everything going purple.Firstly, I don't think this is Josh's problem, as he didn't have a devmon process, whereas this behaviour is typically that devmon hangs (but the process is still running). If you have different behaviour to the I discuss below, please log a new tracker item. The 'hang' issue is covered in this tracker item: http://sourceforge.net/tracker/?func=detail&aid=2897345&group_id=160720&atid=816977 (Unfortunately, it was logged anonymously, and I have had no feedback on improvements in devmon svn for this issue, either via the tracker, or the mails on the mailing list) Discussion of the issue also occurred on the devmon-support mailing list: http://sourceforge.net/mailarchive/forum.php?thread_name=user-13d284bbdc54@xymon.invalid&forum_name=devmon- support The status has not changed, my failure logs still die at: [11-05-05 at 15:54:02] DEBUG: Printing single combo message size 13390 [11-05-05 at 15:54:02] DEBUG: Finished printing single combo message [11-05-05 at 15:55:42] Fork 3 timed out waiting for data from parent: Timeout at /usr/share/devmon/modules/dm_snmp.pm line 516, <$__ANONIO__> line 30203. The printing code is wrapped in an eval'd alarm subroutine which should return within 10 seconds, and log that the printing had completed or that it had timed out. Instead, the fork has noticed that it hasn't seen anything from the 'master' process within the poll period for some time 40s later. The question is, what should be done in this case? Should the forks attempt to kill the master devmon process? Anyway, I would be grateful if someone could reproduce this on a different platform. I currently see this on RHEL5 x86_64 with perl-5.8.8-27.el5. Other environments have been green since 25 Jan ( since they were upgraded to rev 214: http://devmon.svn.sourceforge.net/viewvc/devmon?view=revision&revision=214 ).I created a "devmon watchdog" script that's runs every 5 min using lynx (txt base html browser) which checks if the status of devmon (shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick. I no script expert, but can share the bash script if you want/need.Here is mine, but I am *not* going to add it to svn and the next release unless I have had some feedback on the changes to prevent this occurring at all, preferable with the failure logs the script keeps. I run mine from hobbitlaunch.cfg (the problematic box is still running 4.2.2 for now): [devmon] ENVFILE /usr/lib64/hobbit/server/etc/hobbitserver.cfg CMD /usr/local/bin/restart-devmon-if-purple INTERVAL 1m LOGFILE /var/log/hobbit/devmon-restart.log I have a sudo rule in place to allow the hobbit user to call 'sudo /etc/init.d/devmon stop' #!/bin/bash if [ "$BB" == "" ] then echo "This script must be run under a Hobbit or Xymon environment"&2 echo "e.g. by: bbcmd $0" >&2 exit 1 fi if [ "$BBDISPLAYS" != "" ] thenBBDISP=${BBDISPLAYS#,*} fi COLOR=$($BB $BBDISP "hobbitdboard host=$HOSTNAME test=dm" | cut -d'|' -f3) if [ "`id -u`" -eq 0 ] then DEVMON="/etc/init.d/devmon" PKILL="pkill" else DEVMON="sudo /etc/init.d/devmon" PKILL="sudo pkill" fi if [ "$COLOR" == "purple" ] then LOGSAVE=/var/log/devmon/failures/devmon-failure-`date +%Y-%m-%d-%H:%M: %S`.log echo "Devmon is purple, saving last 200 lines of log to $LOGSAVE" tail -n200 /var/log/devmon/devmon.log > $LOGSAVE $DEVMON stop NUM=$(pgrep -u devmon|wc -l) if [ "$NUM" -ne 0 ] then echo "Devmon failed to stop cleanly, terminating manually" $PKILL -u devmon sleep 5 fi NUM=$(pgrep -u devmon|wc -l) if [ "$NUM" -ne 0 ] then echo "Devmon failed to terminate cleanly, killing manually" $PKILL -9 -u devmon fi $DEVMON start else [ "$DEBUG" == 1 ] && echo "Devmon isn't purple, it is $COLOR" fi Regards, Buchan
list John P Martin
I agree it's a bit off-topic, but just to answer the question:
The "x" prefix for testing variables (more commonly the upper case "X",
because that's the example in the man page :-) is common practice to avoid
the test getting confused by unexpected values in the variable, In
particular, the test tends to throw the comparison out if the variable
should start with a "-". Prefixing the variable would convert this to
"X-", which is correctly processed by the test comparison.
For example:
VAR="-value"
[ "$VAR" == "something" ] will fail, trying to process "-value" as a
qualifier.
[ "X$VAR" == "Xsomething" ] will correctly find an inequality
Cheers,
John
JOHN MARTIN
▸
From: Ryan Novosielski <user-ae4522577e16@xymon.invalid>
To: xymon at xymon.com
Date: 31/05/2011 08:22
Subject: Re: [Xymon] Configuring Devmon for the first time
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The X is a trick that deals with empty variables, and I suppose keeps
some interpreters from complaining about doing a test on a blank variable.
I've seen this done frequently enough to know that people do it, but I
agree, it looks a little odd and I'm not sure I'd write a program that
way myself. This is off topic, but I'd love to know if anyone has any
comments on that particular thing. Shortcut to avoid needing to check
for empty variables I guess?
On 05/31/2011 12:57 AM, Josh Luthman wrote:That probably makes more sense then to use Lynx, good idea. What's with the "x" in the variable? Would you mind telling me what values you used for date? Josh Luthman Office: XXX-XXX-XXXX Direct: XXX-XXX-XXXX XXXX Wayne St Suite XXXX Troy, OH XXXXX On Tue, May 31, 2011 at 12:53 AM, David Baldwin <user-cbbf693f2c89@xymon.invalid <mailto:user-cbbf693f2c89@xymon.invalid>> wrote: On 31/05/11 11:24 AM, user-7cb0f5662626@xymon.invalid <mailto:user-7cb0f5662626@xymon.invalid> wrote:I've had issues with devmon not updating the bb-display and everything going purple. I've had this issue since day one (which is over two years now). I created a "devmon watchdog" script that's runs every 5 min using lynx (txt base html browser) which checks if the status of devmon(shows as dm test) on bb-monitor. If its purple then I kill the devmon process and start it up again....band-aid solution, but it does the trick.I no script expert, but can share the bash script if you want/need.Here's mine (replace xymonserver with your hostname): #!/bin/sh COL=`bb xymonserver "hobbitdboard xymonserver.dm <http://xymonserver.dm>; fields=color"` if [ "x$COL" == "xpurple" ] ; then (date "+%x %X restarting purple devmon" /etc/init.d/devmon restart) | tee /var/log/devmon-restart.log | mail -s "Restarting devmon" xymonadmin fi
- -- - ---- _ _ _ _ ___ _ _ _ |Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Sr. Systems Programmer |$&| |__| | | |__/ | \| _| |user-ae4522577e16@xymon.invalid - 973/972.0922 (2-0922) \__/ Univ. of Med. and Dent.|IST/CST-Academic Svcs. - ADMC 450, Newark -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk3kiUMACgkQmb+gadEcsb5yCwCg2I2+K79zvEHjbvpVrPyEf3vg XTgAoIdr0SfWmctf+B41YHb1y6XMXJz7 =o/i3 -----END PGP SIGNATURE-----
[attachment "novosirj.vcf" deleted by John P Martin/GIS/CSC]
list Buchan Milne
▸
On Thursday, 2 June 2011 09:37:01 John P Martin wrote:
I agree it's a bit off-topic, but just to answer the question: The "x" prefix for testing variables (more commonly the upper case "X", because that's the example in the man page :-)
Out of curiosity, which man page?
▸
is common practice to avoid the test getting confused by unexpected values in the variable,
in crappy shells (typically found on crufty old proprietary Unix).
▸
In particular, the test tends to throw the comparison out if the variable should start with a "-". Prefixing the variable would convert this to "X-", which is correctly processed by the test comparison. For example: VAR="-value" [ "$VAR" == "something" ] will fail, trying to process "-value" as a qualifier. [ "X$VAR" == "Xsomething" ] will correctly find an inequality
$ foo=purple;if [ "$foo" == "purple" ];then echo yes;else echo no;fi yes $ foo="-blue";if [ "$foo" == "purple" ];then echo yes;else echo no;fi no $ foo="red";if [ "$foo" == "purple" ];then echo yes;else echo no;fi no $ echo $SHELL /bin/bash Regards, Buchan