Page 1 of 2

Network monitoring-ModGearman

Posted: Tue Jul 03, 2018 1:41 am
by progressive.nagiosXI
Hi Team,

We are trying to monitor network devices (Switch) bandwidth using Mod-Gearman technology but unfortunately we are not able to make it,

As i have checked in Nagios XI to monitor switch bandwidth there are two commands
1 -> to check the interface is UP/Down via check_SNMP command
2 -> other command is check_rrdtraf to read file form /var/lib/mrtg/host_XXX.rrd

Please confirm this, If yes then how there is data coming in /var/lib/mrtg directory?
Is there any backend command running through and how can we do it using mod-gearman form client site.

Thanks
Abhijay

Re: Network monitoring-ModGearman

Posted: Tue Jul 03, 2018 10:21 am
by scottwilkerson
Switches using the Switch/Router Wizard checks MUST be setup to run locally and not on workers, because they have to access files located on the Nagios XI server directly.

Re: Network monitoring-ModGearman

Posted: Tue Jul 17, 2018 1:22 am
by progressive.nagiosXI
I"m not looking for Auto-Discovery, It"ll be great if you can share a plugin to monitor bandwidth of interfaces in server and Network Devices.

Thanks
Abhijay

Re: Network monitoring-ModGearman

Posted: Tue Jul 17, 2018 9:22 am
by tmcdonald
As @scottwilkerson mentioned, checks using the Switch/Router Wizard must be run on the Nagios XI server, not on a Mod-Gearman worker. This is because they use check_rrdtraf locally to check the results from an MRTG instance running on the Nagios XI server (this instance is what populates/var/lib/mrtg/host_XXX.rrd).

If you do go the plain check_snmp route that absolutely can be run on a Mod-Gearman worker, but option 2 needs to be local to XI.

Re: Network monitoring-ModGearman

Posted: Tue Jul 17, 2018 12:43 pm
by progressive.nagiosXI
We are able to monitor Interface UP/Down but we need to monitor Interface Bandwidth is there any plugin which i can try,

Re: Network monitoring-ModGearman

Posted: Tue Jul 17, 2018 4:02 pm
by lmiltchev
You can search Nagios Exchange for a suitable plugin. Here's an example of one I found:

https://exchange.nagios.org/directory/P ... ic/details

Testing from the CLI:

Code: Select all

/usr/local/nagios/libexec/check_snmp_bandwidth.sh x.x.x.x community 73 " > 1 " " > 2 "
Traffic CRITICAL - 79.45 Mb/s in Sum|traffic=79.45; > 1 ; > 2 ;0; In=5.09;;;0; Out=74.36;;;0;
Note: I am not "promoting" this particular plugin - this is just an example of what I found on Exchange. I am sure, there are more plugins out there. Test a few and see which one would fit your needs. Once, you find a plugin you like, set up a command and a check in Nagios XI by following the steps, described in the document below:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: Network monitoring-ModGearman

Posted: Mon Jul 23, 2018 3:23 am
by progressive.nagiosXI
Thanks, it works now we are able to do bandwidth monitoring,

Can you please help in monitoring it's CPU as i"m getting below error in this but not sure how to resolve this.

Command ===> ./check_snmp_load.pl -H 10.1.101.21 -v2c -C qw6e5rt4sldf -w 50 -c 90 -p 161 -T hp

no global timeout defined : 5
SNMP v2c login
Checking OID : 1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0
OID returned 4
CPU used 4.0% (<50) : OK


Why the first line is coming in output as because of this not able to monitor using Nagios XI.

Also could you please help with Memory monitoring of this switch.

Re: Network monitoring-ModGearman

Posted: Mon Jul 23, 2018 10:08 am
by lmiltchev
I am not familiar with the plugin and don't know perl but I can see the following section in the code:

Code: Select all

# Check gobal timeout if snmp screws up
if (defined($TIMEOUT)) {
  verb("Alarm at $TIMEOUT");
  alarm($TIMEOUT);
} else {
  verb("no global timeout defined : $o_timeout");
  alarm($o_timeout);
}
The "global" timeout is not specified in the script. You have:

Code: Select all

# Nagios specific
my $TIMEOUT;
Try setting it up, for example:

Code: Select all

# Nagios specific
my $TIMEOUT=10;
Test your check again to see if the "no global timeout defined" message is gone.

Re: Network monitoring-ModGearman

Posted: Tue Jul 24, 2018 2:21 am
by progressive.nagiosXI
Hi It worked but now giving below output

Alarm at 10
SNMP v2c login
Checking OID : 1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0
OID returned 3
CPU used 3.0% (<50) : OK

This is also not working.

Re: Network monitoring-ModGearman

Posted: Tue Jul 24, 2018 9:31 am
by lmiltchev
So, what do you want to see in the output - only the last line? If you do, you will need to modify the plugin. This is out of scope for nagios support, and it falls into the custom development territory. Having said that, you could write a simple wrapper script to modify the output, e.g. to grab only the last line.

Example script:

Code: Select all

#!/bin/bash
output=`/usr/local/nagios/libexec/check_snmp_load.pl -H 10.1.101.21 -v2c -C qw6e5rt4sldf -w 50 -c 90 -p 161 -T hp`
echo "$output" | sed '$!d'
You can then make the script executable and run it:

Code: Select all

chmod +x myscript
./myscript
Note: The command in the script is "hard-coded". You could pass arguments via $1, $2, etc. if you wish. You will need to figure out a way for exiting the script with the correct exit codes, etc. If you don't want to go through all this trouble, you could search for a different plugin that works better for you. Thank you!