Network monitoring-ModGearman

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
progressive.nagiosXI
Posts: 277
Joined: Mon Jul 31, 2017 5:54 am

Network monitoring-ModGearman

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Network monitoring-ModGearman

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
progressive.nagiosXI
Posts: 277
Joined: Mon Jul 31, 2017 5:54 am

Re: Network monitoring-ModGearman

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Network monitoring-ModGearman

Post 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.
Former Nagios employee
progressive.nagiosXI
Posts: 277
Joined: Mon Jul 31, 2017 5:54 am

Re: Network monitoring-ModGearman

Post 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,
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Network monitoring-ModGearman

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
progressive.nagiosXI
Posts: 277
Joined: Mon Jul 31, 2017 5:54 am

Re: Network monitoring-ModGearman

Post 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.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Network monitoring-ModGearman

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
progressive.nagiosXI
Posts: 277
Joined: Mon Jul 31, 2017 5:54 am

Re: Network monitoring-ModGearman

Post 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.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Network monitoring-ModGearman

Post 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked