Open Marco-Total opened 3 years ago
Hi.
Just a short question at the beginning: Do you really use the check_snmp_int.pl from this repo? Perl claims line 1100 but that script has only 1085 lines.
To your questions:
A general tip: Can you start the command on the cli and add -v as an argument? This gives you more details on what this command is doing in the background.
Hi,
first thx for your support!
Sorry, I recopy the source code from git to the checkscript, with the Parameter -S and -v I can see, that the Interface-Speed read corectly:
'/usr/lib64/nagios/plugins/check_snmp_int.pl' '-t' '10' '-H' '172.xx.xx.xx' '-x' 'password' '-L' 'sha,aes' '-X' 'password' '-n' 'eth0' '-l' 'username' '-N' '--label' '-q' '-k' '-e' '-f' '-d' '60' '-c' '280,280,2,2,2,2' '-Y' '-M' '-B' '-w' '200,200,1,1,1,1' '--64bits' -S -v
Alarm in 10 seconds
SNMPv3 AuthPriv login : username, sha, aes
Filter : eth0
OID : 1.3.6.1.2.1.31.1.1.1.1.143, Desc : br1
OID : 1.3.6.1.2.1.31.1.1.1.1.2, Desc : eth0
**Name : eth0, Index : 2**
OID : 1.3.6.1.2.1.31.1.1.1.1.3, Desc : eth1
...
File read returns : 0 with 200 rows
**Interface speed : 100000000**
Write file returned : 0
Interface 0, check 0 : 0.232522642201835
Interface 0, check 1 : 0.242002788990826
Interface 0, check 2 : 0
Interface 0, check 3 : 0
Interface 0, check 4 : 0
Interface 0, check 5 : 0
Use of uninitialized value $speed_real in concatenation (.) or string at /usr/lib64/nagios/plugins/check_snmp_int.pl line 1042.
eth0:UP (in=0.2Mbps/out=0.2Mbps/errors-in=0.0/errors-out=0.0/discard-in=0.0/discard-out=0.0):1 UP: OK | 'eth0_in_bps'=232523;200000000;280000000;0;100000000 'eth0_out_bps'=242003;200000000;280000000;0;100000000 'eth0_in_error'=0c 'eth0_in_discard'=531c 'eth0_out_error'=0c 'eth0_out_discard'=0c 'eth0_speed_bps'=
We use Icinga2, if I read the icinga2 docs, i find a descripten, that Icinga2 support the uom c. https://icinga.com/docs/icinga-2/latest/doc/05-service-monitoring/#unit-of-measurement-uom c - A continuous counter (e.g. interface traffic counters).
sorry, I can program something in principle, but deeper knowledge and experience I do not have, I see myself more as a user ;-)
So it works now for you? If so I will close that issue. Or do you have any further questions?
Hi,
I love this script, but special with the second and third point i can't use the script :-(
Cheers, Marco
Hi Marco.
my $speed_real = "" unless (defined($speed_real));
and I think you should just remove the my
at the beginning.Regards, Steffen
Hi Steffen,
thank you!
Remove thy "my" in line 1041 solve the problem with the output of the line speed!
The Plugin-Output looks good (120 discard packets since last messure), but the Performancedata don't display the delta value since last messure, it shows the all time discard packets:
The first problem is, that the warning and critical value don't display in Icinga Perfomancedata-output:
I want configure, that the sensor go in warning state, when for example the discard packets over 120 discard packets since last messure, see question 2). Now I configured, that the sensor go in warning state when all time discard packetes reach 35.000.000. I hope you understand my bad english! ;-)
'/usr/lib64/nagios/plugins/check_snmp_int.pl' '-t' '10' '-H' '172.00.00.10' '-x' 'password' '-L' 'sha,aes' '-n' 'eth0' '-X' 'password' '-l' 'username' '-N' '--label' '-q' '-k' '-e' '-S' '-d' '60' '-f' '-c' '280,280,50,50,40000000,50' '-Y' '-M' '-B' '-w' '250,250,25,25,35000000,25' '--64bits'
Hi Marco.
Hi,
i wan't use your snmp check script to monitor my network interfaces in icnga2. In my case i create a check command with the following paramaters:
-t 10 snmp timeout in seconds -H host -L <authp,privp> -l snmpv3 username -x password Auth -X password Priv -n
--64bits use 64Bit snmp-counter (for 1GBit/s and higher)
--label
-N use IfName instead ifDeDescr
-Y output performance data in bits/s
-B output performance data in bits instead bytes
-k check Bandwith
-q check Bandwith include error and discard
-f Performance data output for graphite/nagvis/grafana
-e Performance data output include error and discard
-S Include speed in performance (output: $interface$_speed_bps)
-d 60 average of Delta in seconds -M warning and critiacl in Mbps -w 200,200,1,1,1,1 -c 280,280,2,2,2,2
Now I have 3 question for usable and hope, that somebody can help me.
With the Parameter -S i get following error: Use of uninitialized value $speed_real in concatenation (.) or string at /usr/lib64/nagios/plugins/check_snmp_int.pl line 1100. The output looks like this: eth0_speed_bps= Is this a script error?
In every 60s output I see 531 discard-errors on interface: 'eth0_in_discard'=531c Is it possible the only the delta discard and error packets?
The warning and critical level for discards and errors don't work for me:
Is it possible, that the sensor switch to warning/critical, when the delta contains x discard/error-packets?
Thx a lot for every help!