How do I monitor Cisco CPU utilisation ?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
vijilants
Posts: 215
Joined: Wed Jun 12, 2013 2:50 pm

How do I monitor Cisco CPU utilisation ?

Post by vijilants »

System:
Nagios XI Version : 2014R2.7
2.6.32-358.14.1.el6.i686 i686
CentOS release 6.5 (Final)

Hi,

I need to monitor the CPU utilization on Cisco devices and I am unsure as to how to do this using Nagios.

I have heard that this is possible using plugins.

Could someone please point me towards a suitable plugin and also give me detailed instruction on how to install a plug in and get it working as I have never installed one.

Many Thanks
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How do I monitor Cisco CPU utilisation ?

Post by lmiltchev »

There are some plugins on the Nagios Exchange that can possibly get the job done. I did a quick search on the Nagios Exchange with keywords "cisco cpu" and here are the hits I got:

https://exchange.nagios.org/index.php?o ... isco%20cpu

Note: I am not sure which of the listed plugins is going to be "suitable" for the device you are trying to monitor. I would recommend testing a few of them from the command line and compare the results. Once you find one that you like, set up a command and service in XI, and you should be good to go.

For more information on how to manage monitoring plugins, please review our documentation on the topic here:

https://assets.nagios.com/downloads/nag ... lugins.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: How do I monitor Cisco CPU utilisation ?

Post by snapon_admin »

I can tell you that we use this one for ASA devices: https://exchange.nagios.org/directory/P ... EM/details and this one for all our other IOS and NX-OS devices: https://exchange.nagios.org/directory/P ... th/details. Both work great. The NWC health one doesn't seem to work as well for our ASAs which is why we have a different one, but I've sampled just about every one of the plugins on the exchange for this and these 2 have been the best so far in my experience. The NWC check also has a handy hardware health check that checks fans and other environmental stuff as well.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How do I monitor Cisco CPU utilisation ?

Post by lmiltchev »

Thanks for the feedback, snapon_admin!
Be sure to check out our Knowledgebase for helpful articles and solutions!
vijilants
Posts: 215
Joined: Wed Jun 12, 2013 2:50 pm

Re: How do I monitor Cisco CPU utilisation ?

Post by vijilants »

Thank you both.

So I am trying to load the plugin provided by SnapOn for IOS using
https://assets.nagios.com/downloads/nag ... lugins.pdf

I notice that when you browse and add a plugin using the gui, all it appears to do is simply copy any file you like in to /usr/local/nagios/libexec.

So as per the instructions for this particular plugin, this is what I did.....

This is what I did:

1) I unzipped an un tar's the file

2) Did a ./configure; make

3) cp plugins-scripts/check_nwc_health /usr/local/nagios/libexec

4) I now see the plugin Check_NWC_Health under Manage Plugins

5)I then go to Define Monitoring commands in Nagios Core Config Manager - I go to Add Command

6) Under available plugins I select Check_NWC_Health

7) Million dollar question.......what do I do next to Under Command Name and Command Line to monitor CPU usage ?

Also Command type is set to "check Command" ...is this correct ?

Many Thanks





Many Thanks
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: How do I monitor Cisco CPU utilisation ?

Post by ssax »

Here is what I do:

Code: Select all

cd /usr/local/nagios/libexec
./check_nwc_health -h
That will give you the options that it supports.

Then create the command like this:

Command Name: check_nwc_health
Command Line:

Code: Select all

$USER1$/check_nwc_health --hostname $HOSTADDRESS$ --mode $ARG1$ --community '$ARG2$' --warning $ARG3$ --critical $ARG4$ $ARG5$
You can add anything else you need to the command as well but that seems to be the basic settings.

Now under your service set:

$ARG1$ = cpu-load
$ARG2$ = snmp community
$ARG3$ = warning threshold
$ARG4$ = critical threshold
$ARG5$ = you can pass in any other arguments that you need here that differ from the basic command.

You best option is to test from the command line first to make sure it's working the way you want it to:

Code: Select all

cd /usr/local/nagios/libexec
./check_nwc_health --hostname 192.168.4.44 --mode cpu-load --community 'mycommunity' --warning 60 --critical 80
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: How do I monitor Cisco CPU utilisation ?

Post by snapon_admin »

Command name can be pretty much whatever you want, but definitely make it something relevant to what it's checking and/or the plugin name. Here's mine as an example:
NWC cpu command definition.png
EDIT: ssax beat me to it lol. Also, yes, check command is the correct type.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: How do I monitor Cisco CPU utilisation ?

Post by ssax »

Thanks snapon_admin, it's probably better to go with the specific command setup like you've posted instead of the generic command like mine so you don't need to remember what everything is.
vijilants
Posts: 215
Joined: Wed Jun 12, 2013 2:50 pm

Re: How do I monitor Cisco CPU utilisation ?

Post by vijilants »

snapon_admin wrote:Command name can be pretty much whatever you want, but definitely make it something relevant to what it's checking and/or the plugin name. Here's mine as an example:
NWC cpu command definition.png
EDIT: ssax beat me to it lol. Also, yes, check command is the correct type.
Thank you all for your help

OK....Done......now, how do I use this ?

When I use Network/ Switch Wizard, will this come up as one of the objects that can be monitored on the device ?

In other words, do I need to rescan the device to get this working against it and set the percentages for Warning an Critical in a similar method as to you would do with the bandwidth ??

Many Thanks
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: How do I monitor Cisco CPU utilisation ?

Post by jdalrymple »

When you add custom plugins there is no magic integration with the wizards. Furthermore the switch and router wizard has some magic of its own, and as such it is exclusively used for monitoring port metrics, nothing else.

You will have to manually create your service in the CCM. It's all in the document you referenced earlier:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Locked