Page 1 of 1

Check Cisco Catalyst - plugin help

Posted: Wed Apr 06, 2016 1:51 pm
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$
}

Re: Check Cisco Catalyst - plugin help

Posted: Wed Apr 06, 2016 4:57 pm
by tmcdonald
What syntax error do you keep getting?

Re: Check Cisco Catalyst - plugin help

Posted: Wed Apr 06, 2016 5:00 pm
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)

Re: Check Cisco Catalyst - plugin help

Posted: Thu Apr 07, 2016 5:14 am
by nozlaf
have you tried running the check command from the command line to verify that you have the correct syntax?

Re: Check Cisco Catalyst - plugin help

Posted: Thu Apr 07, 2016 9:26 am
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

Re: Check Cisco Catalyst - plugin help

Posted: Thu Apr 07, 2016 9:33 am
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.

Re: Check Cisco Catalyst - plugin help

Posted: Thu Apr 07, 2016 9:53 am
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 :)

Re: Check Cisco Catalyst - plugin help

Posted: Thu Apr 07, 2016 10:33 am
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.

Re: Check Cisco Catalyst - plugin help

Posted: Thu Apr 07, 2016 5:44 pm
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

Re: Check Cisco Catalyst - plugin help

Posted: Fri Apr 08, 2016 10:11 am
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.