bonomani / devmon Goto Github PK
View Code? Open in Web Editor NEWDevmon is an open-source SNMP monitoring tool that can graph and alert several hundreds of devices per minutes
License: GNU General Public License v2.0
Devmon is an open-source SNMP monitoring tool that can graph and alert several hundreds of devices per minutes
License: GNU General Public License v2.0
Module dm_tests.pm, after lines 2984 and 3069, one line of comment is missing:
# results in a significant performance improvement.
Dear All,
I would like to change the guest column from the vmware-esxi6 test so that it goes yellow if a change happens like, a vm is powered off, has [dis]appeared (probably vMotion). Can someone give me a hint, what transforms or thresholds can be used for this. The only thing I came up with is the "DELTA" transform, but I think it is only for numerical values.
Thank you in advance!
Regards
Dear all,
I'm writing a template where, depending on the devices physical configuration, some OIDs (leaf, not branch) might be empty. As soon as this happens, the test becomes white saying "No data.". I've tried many many configurations to force devmon to overwrite the clear status for that OID with green, but I have not found any working solution. Is this even possible? If so, how?
Thank you in advance!
Regards
Oliver
Encryption is a must have feature and requirement for most customers
A. Polling
B. Devmon to xymon:
C. Devmon to devmon: (Sync) WIP: Workaround Stunnel (see bellow)
Xymon also support xymoncgimsg.cgi which depends on http server. Also as this use curl or wget this option can pass proxies easely.
Encypting the Traffic between Xymon Client and Server
From: https://salsa.debian.org/debian/xymon/blob/master/debian/README.encryption
If you want to encrypt the reporting traffic between Xymon client and
server, you can use stunnel (Debian package stunnel4
).
Besides the normal stunnel configuration, you need the according
tunnel entries in /etc/stunnel/stunnel.conf
.
(If you like, you can also use a different names for the connection,
e.g. xymons
or a differnt port number, but 1983 seems the proper
"not yet 1984" port number. Of course, the port number should be the
same on client and server side.)
Stunnel Client Side Configuration
[bbs]
accept = 127.0.0.1:1984
connect = <your-xymon-server>:1983
client = yes
Stunnel Server Side Configuration
[bbs]
accept = 1983
connect = 1984
Further documentation
See the section
Encryption and Tunnelling
in the
Administration Guide for System Monitoring with Xymon
at Wikibooks for a more detailed (and not Debian-specific)
documentation.
Now more and more people required encryption
I am installing "devmon" to add snmp monitoring to Xymon and when i try to run ".../devmon/devmon --readbbhosts" i get the following "Error":
Experimental keys on scalar is now forbidden at .../devmon/modules/dm_snmp.pm line 818.
Type of arg 1 to keys must be hash or array (not hash element) at .../devmon/modules/dm_snmp.pm line 818, near "} ) "
Experimental keys on scalar is now forbidden at .../devmon/modules/dm_snmp.pm line 820.
Type of arg 1 to keys must be hash or array (not hash element) at .../devmon/modules/dm_snmp.pm line 820, near "} )"
Compilation failed in require at .../devmon/devmon line 21.
BEGIN failed--compilation aborted at .../devmon/devmon line 21 (#1)
(F) An experimental feature added in Perl 5.14 allowed each, keys,
push, pop, shift, splice, unshift, and values to be called with a
scalar argument. This experiment is considered unsuccessful, and
has been removed. The postderef feature may meet your needs better.
Uncaught exception from user code:
Experimental keys on scalar is now forbidden at .../devmon/modules/dm_snmp.pm line 818.
Type of arg 1 to keys must be hash or array (not hash element) at .../devmon/modules/dm_snmp.pm line 818, near "} ) "
Experimental keys on scalar is now forbidden at .../devmon/modules/dm_snmp.pm line 820.
Type of arg 1 to keys must be hash or array (not hash element) at .../devmon/modules/dm_snmp.pm line 820, near "} )"
Compilation failed in require at .../devmon/devmon line 21.
BEGIN failed--compilation aborted at .../devmon/devmon line 21._
The details of my devmon installation are as follows:
I have been googling but I have not been able to find a solution... could you give me a hand?
Thank you very much in advance
While doing "devmon -vvv --readbbhosts", the SNMPv3 enabled hosts will not be validated and added to hosts.db
Manual snmpwalk with right/same credentials on device works
If it can help you you can fill the template below
Expect hosts.db to contain an entry similar to:
"device"_A^["ip-address"^[161^[xymon_host^[brocade^[SANswitch^[3^[^["username"^[noAuthNoPriv^[^[^[^[^[all^[^[
or
"device"^["ip-address"^[161^[xymon_host^[brocade^[SANswitch^[3^[^["username"^[authPriv^[^[^[^[^[all^[^[
(
Both are from hosts.db after modified dm_snmp.pm,but with different devmon.cfg. First is default devmon.cfg, second is modified as below
SECLEVELS=authPriv
AUTHPROTOS=SHA
PRIVPROTOS=AES
###SECLEVELS=noAuthNoPriv,authNoPriv,authPriv
###AUTHPROTOS=,MD5,SHA
###PRIVPROTOS=,DES,AES
hosts.db do not get updated, hence devices won't populate into configuration.
No screenshots, but some logging..
Operating system:
Linux is-storaged-a.oneadr.net 3.10.0-1160.49.1.el7.x86_64
Xymon version:
Xymon version 4.3.28
Perl version:
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 44 registered patches, see perl -V for more detail)
Devmon version:
devmon-v0.21.08.13
Additional context
==== Initial ===
No hosts.db file
No modification in dm_snmp.pm or devmon.cfg
SECNAMES="username"
AUTHPASSS=,"password"
PRIVPASSS=,"password"###SECLEVELS=noAuthNoPriv,authNoPriv,authPriv
###AUTHPROTOS=,MD5,SHA
###PRIVPROTOS=,DES,AES
DEBUG INFORMATION:
INFOR CONF: Net-SNMP is installed and provides SNMPv2c and SNMPv3
INFOR CONF: SNMP_Session is installed and provides SNMPv1
INFOR CONF: Reading hosts.cfg
INFOR CONF: 34 new host(s) left, trying cid:'"community"' and snmp v2
ERROR SNMP(1): Bulkwalk timeout: 40[sec] (Timeout=20 * (1 + Retries=1))
ERROR SNMP(1): Bulkwalk timeout: 40[sec] (Timeout=20 * (1 + Retries=1))
ERROR SNMP(1): Bulkwalk timeout: 40[sec] (Timeout=20 * (1 + Retries=1))
INFOR CONF: 3 new host(s) left, trying secname:'"username"', seclevel:'noAuthNoPriv', authproto:'', authpass:'', privproto:'', privpass:'' and snmp:v3
ERROR SNMP(1): Cannot do bulkwalk: Unsupported security level (-34)
ERROR SNMP(1): Cannot do bulkwalk: Unsupported security level (-34)
ERROR SNMP(1): Cannot do bulkwalk: Unsupported security level (-34)
INFOR CONF: 3 new host(s) left, trying secname:'"username"', seclevel:'authNoPriv', authproto:'MD5', authpass:'"password"', privproto:'', privpass:'' and snmp:v3
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
INFOR CONF: 3 new host(s) left, trying secname:'"username"', seclevel:'authNoPriv', authproto:'SHA', authpass:'"password"', privproto:'', privpass:'' and snmp:v3
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
INFOR CONF: 3 new host(s) left, trying secname:'"username"', seclevel:'authPriv', authproto:'MD5', authpass:'"password"', privproto:'DES', privpass:'"password"' and snmp:v3
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
INFOR CONF: 3 new host(s) left, trying secname:'"username"', seclevel:'authPriv', authproto:'MD5', authpass:'"password"', privproto:'AES', privpass:'"password"' and snmp:v3
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
INFOR CONF: 3 new host(s) left, trying secname:'"username"', seclevel:'authPriv', authproto:'SHA', authpass:'"password"', privproto:'DES', privpass:'"password"' and snmp:v3
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
INFOR CONF: 3 new host(s) left, trying secname:'"username"', seclevel:'authPriv', authproto:'SHA', authpass:'"password"', privproto:'AES', privpass:'"password"' and snmp:v3
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
ERROR SNMP(1): Cannot do bulkwalk: Authentication failure (incorrect password, community or key) (-35)
INFOR CONF: 3 new host(s) left, trying cid:'"community"' and snmp v1
ERROR SNMP: snmpget "device1" (no response received)
ERROR SNMP: snmpget "device2" (no response received)
ERROR SNMP: snmpget "device3" (no response received)
INFOR CONF: DBFILE: "path"/devmon-v0.21.08.13/hosts.db
INFOR CONF: Fork with pid 27614 received signal TERM, shutting down with return code 0
No entry in hosts.db about device, v3
=== modify dm_snmp.pm ===
No hosts.db file
modification in devmon.cfg and dm_snmp.pm right after line 800 - hardcoded credentials like:
$snmpvars{SecName} = ""username"";
$snmpvars{SecLevel} = "authPriv";
$snmpvars{AuthProto} = "SHA";
$snmpvars{AuthPass} = "password";
$snmpvars{PrivProto} = "AES";
$snmpvars{PrivPass} = "password";
SECNAMES="username"
AUTHPASSS=,"password"
PRIVPASSS=,"password"
SECLEVELS=,authPriv
AUTHPROTOS=,SHA
PRIVPROTOS=,AES
DEBUG INFORMATION:
INFOR CONF: Net-SNMP is installed and provides SNMPv2c and SNMPv3
INFOR CONF: SNMP_Session is installed and provides SNMPv1
INFOR CONF: Reading hosts.cfg
INFOR CONF: 34 new host(s) left, trying cid:'"community"' and snmp v2
INFOR CONF: 3 new host(s) left, trying secname:'"username"', seclevel:'noAuthNoPriv', authproto:'', authpass:'', privproto:'', privpass:'' and snmp:v3
INFOR CONF: Valid new host:"device1", trying secname:'"username"', seclevel:'noAuthNoPriv', authproto:'', authpass:'', privproto:'', privpass:'' and snmp:v3
INFOR CONF: Valid new host:"device2", trying secname:'"username"', seclevel:'noAuthNoPriv', authproto:'', authpass:'', privproto:'', privpass:'' and snmp:v3
INFOR CONF: Valid new host:"device3", trying secname:'"username"', seclevel:'noAuthNoPriv', authproto:'', authpass:'', privproto:'', privpass:'' and snmp:v3
DEBUG CONF: Sending data to SNMP
DEBUG SNMP(1): Got EOF in message, attempting to thaw
DEBUG SNMP(1): SNMP session started: Device="device1", RemotePort=161, DestHost="ip", Version=3
DEBUG SNMP(1): Swap oid type repeaters:1->0 non-repeaters:0->1 for device "device1"
DEBUG SNMP: Fork 1 has data for device "device1", reading it
DEBUG SNMP: Fork 1 returned complete message for device "device1"
DEBUG SNMP: Dethawing data for "device1"
DEBUG SNMP(1): Got EOF in message, attempting to thaw
DEBUG SNMP(1): SNMP session started: Device="device2", RemotePort=161, DestHost="ip", Version=3
DEBUG SNMP(1): Swap oid type repeaters:1->0 non-repeaters:0->1 for device "device2"
DEBUG SNMP: Fork 1 has data for device "device2", reading it
DEBUG SNMP: Fork 1 returned complete message for device "device2"
DEBUG SNMP: Dethawing data for "device2"
DEBUG SNMP(1): Got EOF in message, attempting to thaw
DEBUG SNMP(1): SNMP session started: Device="device3", RemotePort=161, DestHost="ip" Version=3
DEBUG SNMP(1): Swap oid type repeaters:1->0 non-repeaters:0->1 for device "device3"
DEBUG SNMP: Fork 1 has data for device "device3", reading it
DEBUG SNMP: Fork 1 returned complete message for device
DEBUG SNMP: Dethawing data for "device3"
INFOR CONF: DBFILE: "path"/devmon-v0.21.08.13/hosts.db
INFOR CONF: Fork with pid 50348 received signal TERM, shutting down with return code 0
hosts.db file updated correct with all 3 devices
Insert your Devmon log here
There is currently a WIP on this subject, mainly based on the idea/implementation of coec
Workaround for #73
Follow up:
Bonomani,
I was just about to do a new devmon install and came across this repository. I see you've been making some changes and wonder if you consider the changes as committed to be stable.
The last update to the code on sourceforge was about 3 years ago.
The devmon program, when run in "--readbbhosts" mode, incorrectly parses the DEVMON: tag from hosts.cfg.
Example: DEVMON: tag has model(cisco),cid(public),ip(10.0.0.161)
, then the comma after cid() is stripped before parsing, causing the model() and ip() options to be merged into model(cisco)ip(10.0.0.161)
without the comma. Subsequent parsing detects the model() option, but the ip() option is not recognised due to there being no comma having being stripped by the code that detects cid().
Devmon logs the message:
2023-10-09T11:00:13.759+1100|ERROR|config |30898|1778|Unknown devmon option (ip(10.0.0.161)) on line 2 of /etc/xymon/hosts.cfg
If cid() is the last entry, then this problem doesn't occur, because there are no commas after it.
Other options (ip(), port(), model()) have the same problem, in that they impact some options that follow them, because they parse/strip the options list in the same way.
ย
If it can help you you can fill the template below
Unknown devmon option (ip(10.0.0.161))
The cid() option should work anywhere in the DEVMON tag.
The cid() option when not used last, can affect some options that follow.
If applicable, add screenshots to help explain your problem.
RHELv7.9
Xymon v4.3.30
Perl v5.16.3
Devmon v0.22.06 (code has not changed in Github version)
Additional context
Add any other context about the problem here.
2023-10-09T11:00:13.759+1100|ERROR|config |30898|1778|Unknown devmon option (ip(10.0.0.161)) on line 2 of /etc/xymon/hosts.cfg
The problem arrives when:
If we use the best transform and 1 oid is yellow and 1 is red, the page render "red" which is wrong.
(This is also observerd in the original code from sourceforge)
The problem is due to a missbehaviour of the rendering code of a page for the best transform
Workaround: do not use {oid.color} for each oid in the best transform, use only {bestoid.color}
The published versions of the Perl modules do contain large chunks of dead code, often labeled in a comment section as 'work in progress' (WIP). Please remove those dead code sections from the published, main branch and move them into a development branch.
Dear Bonomani,
there is another difference between legacy devmon and the version from this fork. We have a template for the Cisco 2960X series as an example, but other template show the same behavior. The new devmon reports a lot of "NaN", probably caused by division by zero or maybe due to division by "null"/"nil" (basically empty value). Unfortunately the devmon trace does not show any error messages, so I think, it's "working as designed". These are screenshots from new devmon:
On the old devmon querying the same device with the same template the result looks like this:
My guess is there is something different now with the MATH oder DELTA transform, please have a look at the transform file from the template:
# cat transforms
# Get bit speed delta (so we dont have to provide custom delta limit)
ifInOps : DELTA : {ifInOctets}
ifOutOps : DELTA : {ifOutOctets}
# Convert our octets delta into bits per second
ifInBps : MATH : {ifInOps} x 8
ifOutBps : MATH : {ifOutOps} x 8
# Do delta transform on all error counters
ifInEps : DELTA : {ifInErrors}
ifOutEps : DELTA : {ifOutErrors}
# Perform error to traffic percentage calculations
ifInErrPct : MATH : ({ifInEps} / {ifInBps}) x 100
ifOutErrPct : MATH : ({ifOutEps} / {ifOutBps}) x 100
# Create an alias in a bracketed box, or nothing if alias is blank
ifAliasBox : REGSUB : {ifAlias} /(\S+.*)/ [$1]/
Then interesting part is, that the ports showing the NaN / undefined messages are in state "admin down". (The exeption files for this template is the same on both devmon versions.)
I can provide further details, if needed, like trace logs.
Regards
EDIT1:
Changing from "auto" to "session" in dm_config.pm (line 246) shows the same behavior.
The file devmon.cfg has this section (near the end of the file):
# SNMPTRIES: Number of attempts an SNMP query will make before it gives
# up. More than 3 or so might be overkill here
# [DEFAULT: 2] (must be greater than 0)
#SNMPTRIES=2
When I set SNMPTRIES, devmon fails with this message:
Unknown option 'snmptries' in config file, line 167
I used this setting with a previous verison of devmon, so the code seems to have been changed.
If it can help you you can fill the template below
Adding config option according to comments that describe it in the configuration file should produce the described behaviour.
Adding config option according to comments that describe it in the configuration file causes devmon to fail.
OS RHELv7
Xymon version: v4.3.30
Perl version:
Devmon version: current devmon-main branch
2024-03-07T13:36:14.089+1100|FATAL|config |46026|1381|Unknown option 'snmptries' in config file, line 167
On the line of the Xymon/Devmon itself we have a "dm" test (for DevMon)
Clear means that we don't have data, it can be because of a problem. If it's a problem, these data can be interesting, even more, if
Current trends: We keep for now
# ./devmon -vvv --readbbhosts
Experimental keys on scalar is now forbidden at /usr/lib/xymon/server/ext/devmon/modules/dm_config.pm line 734.
Type of arg 1 to keys must be hash or array (not hash element) at /usr/lib/xymon/server/ext/devmon/modules/dm_config.pm line 734, near "} ) "
BEGIN not safe after errors--compilation aborted at /usr/lib/xymon/server/ext/devmon/modules/dm_config.pm line 2740.
Compilation failed in require at ./devmon line 20.
BEGIN failed--compilation aborted at ./devmon line 20.
Operating system:
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
Xymon version:
#apt show xymon
Package: xymon
Version: 4.3.30-1+b2
Priority: optional
Section: net
Source: xymon (4.3.30-1)
Perl version:
# perl --version
This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-linux-gnu-thread-multi
(with 52 registered patches, see perl -V for more detail)
Devmon version:
latest : https://github.com/bonomani/devmon
Some clock information like the uptime is currently in the CPU (cpu_dm) test.
This devmon code introduce a change that should be adapted
Behaviour: Some pages are rendering with color "clear" with "undefined" error message
Excepted: Green
The problem arrives when:
We use the 'math' transform and a division / by an num oid when it is 0: this is not a number anymore
This was introcduce by a change in the code so that the result of a div by 0:
The solution is to override the alarm in the 'threshold' file template
{oid_of_the_math_trans} : clear: NaN :
Remark: The message is empty, but defined! this will not raised any alamed....for NaN values....
Related problem
The problem was also due to a missbehaviour of the rendering code of a page for the best transform: see best transform issue #13 (resolved in current master)
In some case (as the division by zero) we know the problem and we would like to have a specific message for it. We also need to have a way if the color is not overriden, the 'clear' color raised an alarm and an error message: we would like to have a specific error for that case
By default the columns in a table generated by Devmon are aligned to the left side. Some columns become more readable if the content is aligned to the right side, for instance if it only contains a number with a fixed number of decimals right to the decimal point. The following changes will implement this option:
--- dm_tests.pm 2023-09-01 11:21:50.451118647 +0200
+++ dm_tests.pm.new 2023-09-06 13:32:47.694530154 +0200
@@ -2701,11 +2701,14 @@
# Replace our separaters with html
if ( defined $t_opts{nonhtml} ) {
+ $line =~ s/\|>/|/g; # Remove right-align indicator
$line =~ s/\|/:/g;
} elsif ( defined $t_opts{plain} ) {
+ $line =~ s/\|>/|/g; # Remove right-align indicator
$line =~ s/\|/ /g;
} else {
$line =~ s/\|/<\/td><td>/g;
+ $line =~ s/td>>/td align='right'>/g;
}
# Make the first oid (from left to right) the primary one
--- TEMPLATES.md 2023-09-06 12:59:58.813101684 +0200
+++ TEMPLATES.md.new 2023-09-06 13:07:54.433372896 +0200
@@ -1064,6 +1064,7 @@
-<begin file------------------------------
+ TABLE:
Ifc name|Ifc speed|Ifc status
{ifName}{ifAliasBox}|{ifSpeed}|{ifStat.color}{ifStat}{ifStat.errors}
@@ -1078,7 +1079,11 @@
Devmon basically just builds an HTML table out of the repeater data. It can
have an optional header, which should be specified on the line immediately
after the 'TABLE:' tag. If no table header is desired, the line after the
- table tag should be the row data identifier.
+ table tag should be the row data identifier. The column separator in the
+ header line is a '|'. By default the content of a column will be left
+ aligned. If the content should be aligned on the right side, use '|>' rather
+ than '|' as the separator. Note that the leftmost column cannot be right
+ aligned in this way.
The row data identifier is the one that contains one or more data aliases.
The first of these aliases is referred to as the 'primary' alias, and must be
Note: the diff above also solves a small error in the description of the TABLE: directive.
Brainstorming information (should be consolidated in a more globale view)
Ability to perform test on multiple host
Having a (fake) test on a fake device could be used to test all features of DEVMON (transforms, error propagation ...) to create a spec. This would mainly help developpers, but can also give some hints if something fails for others
Current proposal: use fake host (as it is not a host) with:
I implemented a first approach for a Spanning Tree Protocol test. It goes yellow if the last spanning tree topology change is younger than 3 minutes. This might need to be adjusted depending on the polling cycle of devmon.
The purpose of this is to help identify package flooding caused by STP topology changes.
On the Cisco IOS CLI one can see the origin, where the STP-TC (topology change) came from. Unfortunately I could not find an OID holding that information. Can you help out here?
Thank you in advance.
I created a branch in my fork, can you please check it out? https://github.com/roemer2201/devmon/tree/SpanningTreeProtocol
Hello!
As far as I can see there is only a tag for running certain tests from a template, but not the other way around. I would like to filter out certain tests. This might come in handy for systems with a modular approach, where certain OIDs do not exist until a hardware module is plugged in.
Would be nice to hear back from you!
Regards
Dear Bonomani,
yesterday we installed the most current version of devmon from this fork on a xymon/devmon test system. There we ran into a strange issue: We got some custom templates for some liquid cooling devices in the servers room. The OIDs there are dynamically generated by the way single components are connected to the controlling motherboard. Because of that, almost every rack needs its own template. The behavior also prevents the use of OID branches, this is why i created a template with around 130 leaf OIDs.
Now the current devmon is stuck at 100% CPU for the main process (not the forks), as soon as one of these templates is involved in the query. The fork which actually does the query crashes with this message:
[22-03-15@16:05:16] INFOR SNMP(1): Do bulkwalk
Can't use an undefined value as an ARRAY reference at
/usr/local/devmon/modules/dm_snmp.pm line 992, <__ANONIO__> line 21 (#1)
(F) A value used as either a hard reference or a symbolic reference must
be a defined value. This helps to delurk some insidious errors.
Uncaught exception from user code:
Can't use an undefined value as an ARRAY reference at /usr/local/devmon/modules/dm_snmp.pm line 992, <__ANONIO__> line 21.
dm_snmp::snmp_bulkwalk(HASH(0x8028c9ab0), HASH(0x8021eb378), 0) called at /usr/local/devmon/modules/dm_snmp.pm line 832
dm_snmp::fork_sub(1) called at /usr/local/devmon/modules/dm_snmp.pm line 525
dm_snmp::fork_queries() called at /usr/local/devmon/modules/dm_snmp.pm line 210
dm_snmp::snmp_query(HASH(0x8021bd6d8)) called at /usr/local/devmon/modules/dm_snmp.pm line 176
dm_snmp::poll_devices() called at /usr/local/devmon/devmon line 44
[22-03-15@16:05:16] DEBUG SNMP: Fork 1 has data for device Lampertzzelle_GEL_CMC, reading it
[22-03-15@16:05:31] ERROR SNMP: Fork HASH(0x8034237b0), pid 14581 stalled on device Lampertzzelle_GEL_CMC: Timeout waiting for EOF from fork
. Killing this fork.
[22-03-15@16:05:31] ERROR SNMP: Sending 1 TERM signal failed: No such process
My collegue and me nailed it down to the following. The actual query seem to happen at line 952 in dm_snmp.pm:
my @nrresp = $session->bulkwalk( $$nrep_count, $$oid_count, $nrvars );
This line can't run properly as soon as the oids file in a template contains more than 100 leaves. For debugging purposes we dropped a debug line before 992 like this, showing us the variables used in the loop:
do_log( "VBARR LOOP oid:$oid poid:$polled_oid vbarr_counter:$vbarr_counter foo:$foo", 0 );
The log then shows the following results:
[22-03-15@16:05:16] INFOR SNMP(1): Do bulkwalk
[22-03-15@16:05:16] VBARR LOOP oid:.1.3.6.1.2.1.1.1.0 poid:.1.3.6.1.2.1.1.1 vbarr_counter:0 foo:1
Can't use an undefined value as an ARRAY reference at
/usr/local/devmon/modules/dm_snmp.pm line 994, <__ANONIO__> line 21 (#1)
(F) A value used as either a hard reference or a symbolic reference must
be a defined value. This helps to delurk some insidious errors.
...
The foo Variable only contains a 1 as soon as there are more than 100 leaves in the template. This means, that the array @nrresp is broken somehow with 101 or more leaves. Can you guess, why there is the limit of 100 and where it comes from? A strict 100 cannot be found anywhere in the code, so it must be limited by accident.
Thank you for your help!
Operating system:
FreeBSD 12.3-RELEASE-p1 GENERIC amd64
Xymon version:
4.3.30
Perl version:
perl 5, version 32, subversion 1 (v5.32.1) built for amd64-freebsd-thread-multi
Devmon version:
v0.21.09
When I query a host of mine on a specific OID, devmon
crashes with the following errors. I ran the command /usr/local/devmon/devmon -vvvvv -f -m host=dora -m test=temp --o=xymon://stdout -1
.
2023-11-05T09:59:19.914+0100|INFO |snmp |2911300| 165|Querying snmp oids on dora for tests temp
2023-11-05T09:59:19.914+0100|DEBUG|snmp |2911300| 644|Starting fork number 1
2023-11-05T09:59:19.919+0100|DEBUG|snmp |2911300| 662|Fork number 1 started with pid 2911305
2023-11-05T09:59:19.919+0100|DEBUG|snmp(1) |2911305| 673|Fork 1 using sockets GLOB(0xaaaae08730f8) <-> GLOB(0xaaaae08730c8) for IPC
2023-11-05T09:59:19.920+0100|DEBUG|snmp(1) |2911305| 675|Fork 1 closing socket (child 1) GLOB(0xaaaae08730f8)
2023-11-05T09:59:19.923+0100|DEBUG|snmp(1) |2911305| 742|Got EOF in message, attempting to thaw
Can't use string ("5") as a HASH ref while "strict refs" in use at
/usr/local/devmon/modules/dm_snmp.pm line 2273, <__ANONIO__> line 13 (#1)
(F) You've told Perl to dereference a string, something which
use strict blocks to prevent it happening accidentally. See
"Symbolic references" in perlref. This can be triggered by an @ or $
in a double-quoted string immediately before interpolating a variable,
for example in "user @$twitter_id", which says to treat the contents
of $twitter_id as an array reference; use a \ to have a literal @
symbol followed by the contents of $twitter_id: "user \@$twitter_id".
Uncaught exception from user code:
Can't use string ("5") as a HASH ref while "strict refs" in use at /usr/local/devmon/modules/dm_snmp.pm line 2273, <__ANONIO__> line 13.
dm_snmp::DiveRef(HASH(0xaaaae00ebc98), SCALAR(0xaaaae08b9bf8), SCALAR(0xaaaae08b9880), SCALAR(0xaaaae08bd3f8), SCALAR(0xaaaae08bbc70), SCALAR(0xaaaae08bbc10), SCALAR(0xaaaae08bb340), SCALAR(0xaaaae08b99a0), ...) called at /usr/local/devmon/modules/dm_snmp.pm line 2159
dm_snmp::deeph_insert_oidval_h("1.3.6.1.4.1.8072.1.5.3.1.2.1.3.6.1.2.1.4.24.4:60", HASH(0xaaaae00ebc98)) called at /usr/local/devmon/modules/dm_snmp.pm line 1391
dm_snmp::fork_sub(1) called at /usr/local/devmon/modules/dm_snmp.pm line 680
dm_snmp::fork_queries() called at /usr/local/devmon/modules/dm_snmp.pm line 284
dm_snmp::snmp_query(HASH(0xaaaadfdd2d90)) called at /usr/local/devmon/modules/dm_snmp.pm line 202
dm_snmp::poll_devices() called at /usr/local/devmon/devmon line 47
2023-11-05T09:59:20.114+0100|DEBUG|snmp |2911300| 316|Fork:1 has data for device:dora, reading it
^C2023-11-05T09:59:20.846+0100|INFO |config |2911300|2790|Master received signal INT, shutting down with return code 0
2023-11-05T09:59:20.846+0100|INFO |config |2911300|2802|Shutting down
The OID is .1.3.6.1.4.1.8072.1.3.2.4.1.2.7.99.112.117.116.101.109.112.1
, which translates into NET-SNMP-EXTEND-MIB::nsExtendOutLine."cputemp".1
. The host is running Linux ("LibreElec" distribution: SNMPv2-MIB::sysDescr.0 = STRING: Linux dora 4.19.127 #1 SMP Tue Jul 6 19:08:37 CEST 2021 armv7l
).
find templates/libreelec-rpi/temp templates/libreelec-rpi/specs -type f -exec echo "FILE {}:" \; -exec cat {} \;
FILE templates/libreelec-rpi/temp/transforms:
cpuTempValue: REGSUB : {cpuTemp} /^(\d+).*$/$1/
gpuTempValue: REGSUB : {gpuTemp} /^(\d+).*$/$1/
FILE templates/libreelec-rpi/temp/thresholds:
cpuTempValue : red : >90 : CPU Boiling
cpuTempValue : yellow : >80 : CPU Heating
gpuTempValue : red : >90 : GPU Boiling
gpuTempValue : yellow : >80 : GPU Heating
FILE templates/libreelec-rpi/temp/exceptions:
FILE templates/libreelec-rpi/temp/oids:
cpuTemp: .1.3.6.1.4.1.8072.1.3.2.4.1.2.7.99.112.117.116.101.109.112.1 :leaf
gpuTemp: .1.3.6.1.4.1.8072.1.3.2.4.1.2.7.103.112.117.116.101.109.112.1 :leaf
FILE templates/libreelec-rpi/temp/message:
{cpuTempValue.color}cpu: {cpuTempValue} °C
{gpuTempValue.color}gpu: {gpuTempValue} °C
FILE templates/libreelec-rpi/specs:
vendor : Raspberry Pi
model : LibreELEC
snmpver : 2
sysdesc : Linux dora 4.19.127 #1 SMP Tue Jul 6 19:08:37 CEST 2021 armv7l
/usr/local/devmon/devmon -vvvvv -f -m host=dora -m test=temp --o=xymon://stdout -1
.Get the answer:
2023-11-05T10:57:06.801+0100|INFO |tests |2914504| 61|Performing tests
2023-11-05T10:57:06.801+0100|DEBUG|tests |2914504| 112|Starting test for temp on device dora
2023-11-05T10:57:06.802+0100|DEBUG|tests |2914504| 329|Doing regsub transform on dora/gpuTempValue
2023-11-05T10:57:06.804+0100|DEBUG|tests |2914504| 162|64
2023-11-05T10:57:06.804+0100|DEBUG|tests |2914504| 329|Doing regsub transform on dora/cpuTempValue
2023-11-05T10:57:06.805+0100|DEBUG|tests |2914504| 162|64
2023-11-05T10:57:06.806+0100|DEBUG|tests |2914504|2281|Rendering temp message for dora
2023-11-05T10:57:06.807+0100|DEBUG|msg |2914504| 35|Running send_msgs()
2023-11-05T10:57:06.807+0100|INFO |msg |2914504| 52|Sending 1 messages to 'xymon://stdout'
status dora.temp green Sun Nov 5 10:57:06 2023
&green cpu: 64 °C
&green gpu: 64 °C
<a href='https://github.com/bonomani/devmon'>Devmon 0.23.09</a> running on astrea
2023-11-05T10:57:06.807+0100|DEBUG|config |2914504| 700|Running time_test()
Crash with stackstrace above.
Operating system:
The target host is running Linux "LibreElec" distribution: SNMPv2-MIB::sysDescr.0 = STRING: Linux dora 4.19.127 #1 SMP Tue Jul 6 19:08:37 CEST 2021 armv7l
.
The master host is running Linux Debian "Bookworm" distribution.
Xymon version:
4.3.30
Perl version:
5.36.0
Devmon version:
latest (2023-11-04)
Additional context
The error seems to tell that the function DiveRef()
is certain that, on its line 26, $$sv
is a hash. In my case it's not, it's a scalar. I can slightly alter the dm_snmp.pm
code and get a functionning software: before line 26 I test if $$sv
is a hash. But my patch is not a corrective patch but a quick workaround. It seems the error is elsewhere, but I cannot find it (I didn't understand the logic used to dive into SNMP keys and values with the functions deeph_insert_oidval_h()
and similar).
Patch to make code work:
--- modules/dm_snmp.pm.orig 2023-11-05 10:43:05.166882587 +0100
+++ modules/dm_snmp.pm 2023-11-05 10:43:54.250826093 +0100
@@ -2267,7 +2267,9 @@
{
$sv = \$$sv->[$key];
} else {
- $sv = \$$sv->{$key};
+ if (ref $$sv eq ref {}) {
+ $sv = \$$sv->{$key};
+ }
}
}
return $sv;
Suggested patch is (sorry I can't clone):
--- /usr/local/devmon/modules/dm_templates.pm.orig 2020-02-03 08:34:17.551832749 +0800
+++ /usr/local/devmon/modules/dm_templates.pm 2020-02-03 08:33:01.471034309 +0800
@@ -904,7 +904,7 @@
}
sub calc_template_test_deps {
my $tmpl = $_[0];
my @Oids = keys %{$tmpl->{oids}};
my $deps = {} ;
my $infls = {} ;
my %trans_data ; #for sort from W. Nelis
@@ -1065,7 +1065,7 @@
my $node;
Hello Team,
I have a strange issue with the templatebuilder.pl in devmon/extras/ folder.
When going to use it to create a template for one Asus Switch , receiving this output error:
./templatebuilder.pl -cpublic -v2c 10.10.10.10
Modification of non-creatable array value attempted, subscript -1 at ./templatebuilder.pl line 46.
Any help will be much appreciated.
Thank you in advance!
Hi
using Xymon and devmon, the SNMP tests for HPE Proliant Gen9 are mostly clear, only occasionally green. These work fine on our Gen5,6,7 servers (I thought we had some 8's but we don;t).
snmpwalk always succeeds.
Thanks
And add samples...
If possible, add SFP test to existing one like if_err
See xymon mailing list 29.9.2022
See devmon wiki on github
Dear All,
I just found this repository and I was very happy, that someone continues working on devmon!
I got the "vmware-esxi6" working for me an I was wondering, how I can graph the data. In the message files I found lines like this:
"TABLE:rrd(DS:ds0:hrProcessorLoad:GAUGE; )"
What do I need to add/edit in Xymons configuration files in order to make the rrd graphing work?
Thank you for your help!
Regards
We would like to add a line in a table like the average of CPU in the first row
We could do something like the following...just ideas!
CPU | SORT by index (if not incresing by +1) | ADD LEAF() | INDEX | MATH (INDEX+1) % COUNT(CPU) +1 | CHAIN (MATH,ADD) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1.1.1.1 | 10 | x | 1 | x | 1 | x | 1 | 1 | 1 | 2 | 1 | AVG CPU | |||||
1.1.1.1 | 20 | y | 2 | z | 2 | y | 2 | 2 | 2 | 3 | 2 | x | |||||
1.1.1.1 | 30 | x | 3 | z | 3 | z | 3 | 3 | 3 | 4 | 3 | y | |||||
4 | AVG CPU | 4 | 4 | 4 | 1 | 4 | z |
A little bit complex....a simpler solution could be to have:
An ADD transform with at-pos(0.1)
And a SORT transform with numerical (only alpha now) sorting and precision 1, ...need also a padding (auto?) because of Xymon limitation
ADD Function
argument
SORT Function
Sort by val
Sort by key is a function composition:
OID | INDEX | SORT by val | CHAIN(SORT by val,OID) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1.1.1.1 | 10 | x | 10 | 10 | 1 | 10 | 1 | x | |||||||||
1.1.1.1 | 20 | y | 20 | 20 | 2 | 20 | 2 | y | |||||||||
1.1.1.1 | 30 | x | 30 | 30 | 3 | 30 | 3 | x |
Would be great if DEVMON was available as an RPM. (Terabithia maybe)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.