Network monitoring-ModGearman
-
- Posts: 277
- Joined: Mon Jul 31, 2017 5:54 am
Network monitoring-ModGearman
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
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
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Network monitoring-ModGearman
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.
-
- Posts: 277
- Joined: Mon Jul 31, 2017 5:54 am
Re: Network monitoring-ModGearman
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
Thanks
Abhijay
Re: Network monitoring-ModGearman
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.
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
-
- Posts: 277
- Joined: Mon Jul 31, 2017 5:54 am
Re: Network monitoring-ModGearman
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
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:
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
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;
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 277
- Joined: Mon Jul 31, 2017 5:54 am
Re: Network monitoring-ModGearman
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.
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
I am not familiar with the plugin and don't know perl but I can see the following section in the code:
The "global" timeout is not specified in the script. You have:
Try setting it up, for example:
Test your check again to see if the "no global timeout defined" message is gone.
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);
}
Code: Select all
# Nagios specific
my $TIMEOUT;
Code: Select all
# Nagios specific
my $TIMEOUT=10;
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 277
- Joined: Mon Jul 31, 2017 5:54 am
Re: Network monitoring-ModGearman
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.
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
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:
You can then make the script executable and run it:
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!
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'
Code: Select all
chmod +x myscript
./myscript
Be sure to check out our Knowledgebase for helpful articles and solutions!