Check Cisco Catalyst - plugin help

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
spyder13337
Posts: 68
Joined: Tue Oct 06, 2015 9:50 pm

Check Cisco Catalyst - plugin help

Post by spyder13337 »

Looking for some assistance with this plugin: https://github.com/ranl/monitor-utils/b ... k-cisco.pl

I'm trying to set up some checks using it and am not sure how to set it up

Anyone using this successfully that may be able to give me an insight on what parameters to use to monitor things like CPU, Memory, Fan status, temperature, etc etc?

what am i missing Syntax error should be be check_snmp then use check_cisco or just just check_cisco
i keep getting syntax error


Thanks a ton!

here is my config file


here is my Define Host

Code: Select all

define host{
        use             generic-switch          ; Inherit default values from a template
        host_name       linksys-srw224p         ; The name we're giving to this switch
        alias           Linksys SRW224P Switch  ; A longer name associated with the switch
        address         XXX.XXX.XXX.XXX           ; IP address of the switch
        hostgroups      switches                ; Host groups this switch is associated with
        }

here is my define Hostgroup

Code: Select all

define hostgroup{
        hostgroup_name  switches                ; The name of the hostgroup
        alias           Network Switches        ; Long name of the group
        }
here is my define servce


# Monitor uptime via SNMP

Code: Select all

define service{
        use                     generic-service ; Inherit values from a template
        host_name               linksys-srw224p
        service_description     Uptime
        check_command           check_snmp!-C public -o sysUpTime.0
        }


# Monitor Port 1 status via SNMP

Code: Select all

define service{
        use                     generic-service ; Inherit values from a template
        host_name               linksys-srw224p
        service_description     Port 1 Link Status
        check_command           check_cisco! -H XXX.XXX.XXX.XXX -C public -t temp -w 50 -c 70
        }
Her is my command.cfg

Code: Select all

# 'check_cisco' command definition
define command{
        command_name check_cisco
        command_line $USER1$/check_cisco -H $HOSTADDRESS$ $USER7$ -n $ARG1$ $ARG2$
}
Last edited by rkennedy on Fri Apr 08, 2016 10:12 am, edited 2 times in total.
Reason: Please use [code][/code] tags around terminal output
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Check Cisco Catalyst - plugin help

Post by tmcdonald »

What syntax error do you keep getting?
Former Nagios employee
spyder13337
Posts: 68
Joined: Tue Oct 06, 2015 9:50 pm

Re: Check Cisco Catalyst - plugin help

Post by spyder13337 »

Code: Select all

Current Status:	  UNKNOWN   (for 0d 5h 18m 26s)
Status Information:	Syntax Error !
check_cisco
-H = Ip/Dns Name of the Switch
-C = SNMP Community
-t = Check type
temp - Temperature
fan - Fan Fail
ps - Power Supply Fail
cpu - CPU Load
mem - Memory
module	- Module Health
freeint - Free eth interfaces for X days (-d)
int - Interface Operation Stat (use with -i or -o)
-w = Warning Value
-c = Critical Value
-d = number of days that the ethernet interface hasn't change state, default is 14 (only for -t freeint)
-i = Interface Name (only for -t int)
-o = Interface OID (only for -t int)
Performance Data:	
Current Attempt:	3/3  (HARD state)
Last Check Time:	04-06-2016 17:53:24
Check Type:	ACTIVE
Check Latency / Duration:	0.000 / 0.072 seconds
Next Scheduled Check:  	04-06-2016 18:03:24
Last State Change:	04-06-2016 12:41:40
Last Notification:	04-06-2016 17:53:24 (notification 6)
Is This Service Flapping?	  NO   (0.00% state change)
In Scheduled Downtime?	  NO  
Last Update:	04-06-2016 17:59:57  ( 0d 0h 0m 9s ago)
Last edited by tmcdonald on Wed Apr 06, 2016 5:13 pm, edited 1 time in total.
Reason: Please use [code][/code] tags around terminal output
User avatar
nozlaf
Posts: 172
Joined: Sun Nov 09, 2014 9:50 pm
Location: Victoria, Australia

Re: Check Cisco Catalyst - plugin help

Post by nozlaf »

have you tried running the check command from the command line to verify that you have the correct syntax?
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
spyder13337
Posts: 68
Joined: Tue Oct 06, 2015 9:50 pm

Re: Check Cisco Catalyst - plugin help

Post by spyder13337 »

i am not sure if i need to edit command.cfg or nrpe.cfg or service.cfg and add something there but

When i run
check_cisco -H XXX.XXX.XXX.XXX -C public -t temp -w 50 -c 70

i get this

Temperature: OK - Temperature is 29 Celsius | temperature=29;50;70
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check Cisco Catalyst - plugin help

Post by rkennedy »

Combined with your service check_command -

Code: Select all

        check_command           check_cisco! -H XXX.XXX.XXX.XXX -C public -t temp -w 50 -c 70
This doesn't look right as you're specifying the $HOSTADDRESS$ twice.

Code: Select all

command_line $USER1$/check_cisco -H $HOSTADDRESS$ $USER7$ -n $ARG1$ $ARG2$
Try changing your service check_command to -

Code: Select all

define service{
        use                     generic-service ; Inherit values from a template
        host_name               linksys-srw224p
        service_description     Port 1 Link Status
        check_command           check_cisco!-C public -t temp -w 50 -c 70
        }
Also, make sure that $USER7$ has a definition since you're referencing it.

As @nozlaf mentioned - give it a try over the CLI before creating a service, that way you can verify the actual command is working.
Former Nagios Employee
spyder13337
Posts: 68
Joined: Tue Oct 06, 2015 9:50 pm

Re: Check Cisco Catalyst - plugin help

Post by spyder13337 »

i change it to this command

# 'check_cisco' command definition
define command{
command_name check_cisco
command_line $USER1$/check_cisco -H $HOSTADDRESS$ $ARG1$ $ARG2$

i will be running a command like this i assume form service.cfg file

check_cisco!-C public -t temp -w 50 -c 70

would this match up do i need to specific single ARG ?

Thank you everyone for your help :)
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check Cisco Catalyst - plugin help

Post by rkennedy »

$ARG1$ will become -C public -t temp -w 50 -c 70 and $ARG2$ will be empty in your example. You can only use $ARG1$ if you'd like, really it's personal preference.
Former Nagios Employee
spyder13337
Posts: 68
Joined: Tue Oct 06, 2015 9:50 pm

Re: Check Cisco Catalyst - plugin help

Post by spyder13337 »

thank everyone for your help but i was able to figure it out i had to treat the cisco router like a host and and service

service command
check_cisco! -H xx.xx.xx.xx -C public -t temp -w 50 -c 70
command

# 'check_cisco' command definition
define command{
command_name check_cisco
command_line $USER1$/check_cisco -H $HOSTADDRESS$ $ARG1$

this worked for me
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check Cisco Catalyst - plugin help

Post by rkennedy »

Ah! There are a multitude of different ways you could have accomplished this, that's what makes Nagios nice! :)

Marking this one as resolved, and closing it out! Feel free to create a new thread if you need any assistance in the future.
Former Nagios Employee
Locked