NIC Traffic monitor

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: NIC Traffic monitor

Post by HAL »

Yes, its a heavy traffic, thats where requirement come in to monitor it.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: NIC Traffic monitor

Post by BanditBBS »

It works for me:

Code: Select all

[clarkj@svwdcnagios02 libexec]$ sudo ./check_win_net_usage.sh -H 10.5.2.34 -p 12489 -i "Intel[R] 82579LM Gigabit Network Connection"
Network OK - 153 Bytes received/sec, 119 Bytes sent/sec|bytes_in=153;bytes_out=119
I was getting all zero information also at first. Everywhere in windows it was showing up as "Intel(R) 82579LM Gigabit Network Connection" instead of "Intel[R] 82579LM Gigabit Network Connection"

Go into Windows Performance Monitor and verify you are using the name of the card that it shows! Also, in your code example, it looks like you have a space after the initial ". Make sure there is not a space after it.

Also realize if you use the "-o KB" option, it still may show 0 if the number of bytes is low. Try leaving off that option until you verify it is working and that will make it report bytes instead of KB.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NIC Traffic monitor

Post by scottwilkerson »

Can you open perfmon.exe on your windows machine
perfmon0.PNG
Select performance Monitor and click the green +
perfmon.PNG
Select Network Interface\Bytes Received/sec
perfmon1.PNG
As BanditBBS pointed out, I also have square braces [] instead of () around an item, make sure your -i argument is exactly what is displayed here.

@BanditBBS - Thanks.
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: NIC Traffic monitor

Post by HAL »

Hi,
Thanks for the information, now I able to fetch the bytes value as expected. Can we set some warning/critical parameters too like -w 80 and -c 90 using this plugin. In plugin help, I was not able to see any parameters for such alerts, please advise.

Regards,
Sanjeev
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NIC Traffic monitor

Post by slansing »

You would have to define them as such:

Code: Select all

$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -p 5666 -c CheckCounter -a "\\Print Queue(_Total)\\Jobs Spooling" ShowAll MaxWarn=2 MaxCrit=20
This is an example command definition, you do not need to follow this exact format, and could add them into the arguments on a per service definition basis. You must define a MaxWarn and a MaxCrit value for the check, if you would like to see the entire output but still be alerted when a threshold is met add ShowAll.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: NIC Traffic monitor

Post by BanditBBS »

Looking at the code of the plugin, short answer is no.

You could modify it to handle sending a warning or critical message, but as it is, no. Might be able to find one that handles it out of the box, but this one does not.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
HAL
Posts: 151
Joined: Thu Sep 27, 2012 7:57 am

Re: NIC Traffic monitor

Post by HAL »

Thanks for the information.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NIC Traffic monitor

Post by slansing »

As shown in the example above if you use NRPE to call CheckCounter on the remote host you can add a Warning and Critical value at the end of the check and it will return Warning or Critical if those thresholds are met. Seeing as you already have NSClient++ configured an example for Bytes Received/Sec would be:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H windows.server.ip -c CheckCounter -a "Counter:=\\Network Interface(Intel[R] PRO_1000 MT Network Connection)\\Bytes Received/Sec" ShowAll MaxWarn=400 MaxCrit=2000
Returns:

Code: Select all

CRITICAL: \Network Interface(Intel[R] PRO_1000 MT Network Connection)\Bytes Received/Sec: 380.045 > critical|'\Network Interface(Intel[R] PRO_1000 MT Network Connection)\Bytes Received/Sec'=380.045354;50;100
Since NSClient++ parses the performance counter returns it can assign values to the returns:

http://www.nsclient.org/nscp/wiki/Check ... eckCounter
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: NIC Traffic monitor

Post by BanditBBS »

slansing wrote:As shown in the example above if you use NRPE to call CheckCounter on the remote host you can add a Warning and Critical value at the end of the check and it will return Warning or Critical if those thresholds are met, example for Bytes Received/Sec:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H windows.server.ip -c CheckCounter -a "Counter:=\\Network Interface(Intel[R] PRO_1000 MT Network Connection)\\Bytes Received/Sec" ShowAll MaxWarn=400 MaxCrit=2000
Returns:

Code: Select all

CRITICAL: \Network Interface(Intel[R] PRO_1000 MT Network Connection)\Bytes Received/Sec: 380.045 > critical|'\Network Interface(Intel[R] PRO_1000 MT Network Connection)\Bytes Received/Sec'=380.045354;50;100
Since NSClient++ parses the performance counter returns it can assign values to the returns:

http://www.nsclient.org/nscp/wiki/Check ... eckCounter
Remember, if you use this method to modify the NSClient settings and in the ini make sure allow_nasty_meta_chars under the NRPE section is set to 1 and not commented out.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NIC Traffic monitor

Post by slansing »

If you do decide to use this performance counter, let us know how it works out for you! They are usually pretty straight forward to play with.
Locked