Nagios ASR Plugin

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Nagios ASR Plugin

Postby faziz » Wed Mar 14, 2018 12:36 am

Hi

I download plugin called "check_cisco_asr_cpu.pl" and copy to /usr/local/nagios/libexec directory
and I gave x permission plus assign to nagios user and group and when try to execute this command it show to me below error

[root@NAG01TSRUH libexec]# ./check_cisco_asr_cpu.pl -h
Can't locate Switch.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_cisco_asr_cpu.pl line 12.
BEGIN failed--compilation aborted at ./check_cisco_asr_cpu.pl line 12.

Thanks
faziz
 
Posts: 14
Joined: Mon Mar 12, 2018 4:47 am

Re: Nagios ASR Plugin

Postby cdienger » Wed Mar 14, 2018 10:45 am

Switch.pm is either not installed or not found in the right location. Run the following to find it:

sudo yum install mlocate
sudo updatedb
sudo locate Switch.pm


Run the following to install Switch.pm:

sudo yum install -y perl-Switch
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 2191
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios ASR Plugin

Postby faziz » Thu Mar 15, 2018 2:20 am

Thank you cdienger for your reply, but The command it looks response, but the result looks not suitable, is that mean there is bug in plugin
"Mod_0_1_CPU0Mod_0_RSP1_CPU0Mod_0_RSP0_CPU0Mod_0_1_0Mod_0_1_1Mod_0_1_CPU0Mod_0_RSP1_CPU0Mod_0_RSP0_CPU0CPU OK: Mod_0_RSP1_CPU0_5min_avg=1%, Mod_0_RSP0_CPU0_5min_avg=1%, Mod_0_1_CP"

and when I run on another asr device it show below result
"UNKNOWN: Unknonwn SNMP sysObjectID: 1.3.6.1.4.1.9.1.1861"
faziz
 
Posts: 14
Joined: Mon Mar 12, 2018 4:47 am

Re: Nagios ASR Plugin

Postby cdienger » Thu Mar 15, 2018 11:21 am

It looks like that the plugin isn't capable of handling that model/OID. Here is the code that generates the messages:

Code: Select all
my $systemOID = $result->{$sysObjectID};
my $model = '';

if ($systemOID eq '1.3.6.1.4.1.9.1.1041') {
    $model = '3945';
} elsif ( $systemOID eq '1.3.6.1.4.1.9.1.1054') {
    $model = 'sm';
} elsif ( $systemOID eq '1.3.6.1.4.1.9.1.1525' or $systemOID eq '1.3.6.1.4.1.9.1.2144') {
    $model = 'asr1k';
} elsif ( $systemOID eq '1.3.6.1.4.1.9.1.1017' or $systemOID eq '1.3.6.1.4.1.9.12.3.1.3.1507' or $systemOID eq '1.3.6.1.4.1.9.1.1018') {
    $model = 'asr9k';
} else {
    print "UNKNOWN: Unknonwn SNMP sysObjectID: $systemOID";
    exit $ERRORS{'UNKNOWN'};
}


There may be a plugin available on the exchange that works with the model or if you know which OIDs you want to monitor you can use the check_snmp check: https://www.monitoring-plugins.org/doc/ ... _snmp.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 2191
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios ASR Plugin

Postby faziz » Sat Mar 17, 2018 11:51 pm

Hi
these below are OID to give memory, it works when use snmpwalk, but when use with check_snmp i got error as clarify below
#snmpwalk -v 2c -c tscmnNT 10.1.10.1 1.3.6.1.4.1.9.9.221.1.1.1.1.18
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.18.7000.1 = Counter64: 424723672

# ./check_snmp -H 10.1.10.1 -C tscmnNT -o 1.3.6.1.4.1.9.9.221.1.1.1.1.18, 1.3.6.1.4.1.9.9.221.1.1.1.1.20
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.4.1.9.9.221.1.1.1.1.18

-How i can convert result to MB or G?


-1.3.6.1.4.1.9.9.221.1.1.1.1.20 gives free memory
-1.3.6.1.4.1.9.9.221.1.1.1.1.18 gives the used memory

Thank you in advanced
faziz
 
Posts: 14
Joined: Mon Mar 12, 2018 4:47 am

Re: Nagios ASR Plugin

Postby cdienger » Mon Mar 19, 2018 10:32 am

It looks like enterprises.9.9.221.1.1.1.1.18.7000.1 is the actual location of the used memory. Try:

# ./check_snmp -H 10.1.10.1 -C tscmnNT -o 1.3.6.1.4.9.9.221.1.1.1.1.18.7000.1

Converting the memory from bytes to MB or G would require additional logic not available in the command itself. You could however use the check in a custom script that performs the calculation.

https://exchange.nagios.org/directory/T ... pt/details
https://assets.nagios.com/downloads/nag ... inapi.html
https://assets.nagios.com/downloads/nag ... inapi.html
http://nagios-plugins.org/doc/guidelines.html

Are some useful documents to help get you started on creating custom plugins.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 2191
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios ASR Plugin

Postby faziz » Sun Mar 25, 2018 4:36 am

Hi cdienger

I tried below command but still display to me same error
#./check_snmp -H 10.1.10.1 -C tscmnNT -o 1.3.6.1.4.1.9.9.221.1.1.1.1.18.7000.1

External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.4.1.9.9.221.1.1.1.1.18.7000.1

Thanks
faziz
 
Posts: 14
Joined: Mon Mar 12, 2018 4:47 am

Re: Nagios ASR Plugin

Postby cdienger » Mon Mar 26, 2018 2:27 pm

Try specifying the protocol version with:

./check_snmp -H 10.1.10.1 -C tscmnNT -o 1.3.6.1.4.1.9.9.221.1.1.1.1.18.7000.1 -P 2c
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 2191
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios ASR Plugin

Postby faziz » Sun Apr 01, 2018 1:58 am

Hi cdienger

Yes it is working now, but I have minor thing if you can notice "c" that show end of result which could effect on threshold limit

./check_snmp -H 192.168.22.5 -C tally -o 1.3.6.1.4.1.9.9.221.1.1.1.1.18.7000.1 -P 2c
SNMP OK - 424723688 | iso.3.6.1.4.1.9.9.221.1.1.1.1.18.7000.1=424723688c
faziz
 
Posts: 14
Joined: Mon Mar 12, 2018 4:47 am

Re: Nagios ASR Plugin

Postby cdienger » Mon Apr 02, 2018 12:30 pm

Interesting. What version of check_snmp is being used(./check_snmp --version to see) ? I tested with 2.2.1 and wasn't able to reproduce. You can download the latest(along with install instructions in the README) from https://www.nagios.org/downloads/nagios-plugins/ .
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 2191
Joined: Tue Feb 07, 2017 11:26 am

Next

Return to Nagios Core

Who is online

Users browsing this forum: Fess [Nagios Bot] and 17 guests