Nagios monitors Windows for network card traffic
Using check_traffic.shin /usr/local/nagios/libexec/ , you can monitor not only the network card traffic of Linux , but also the Windows traffic to the server.
1 check_traffic.shUsage usage
[Email protected] Libexec]#/usr/local/nagios/libexec/check_traffic.sh-h |
Usage: ./check_traffic.sh [-v] [-6] [-r]-v 1|2c|3-c snmp-community-h host [-l]-i interface-w in, Out-warning-value -C in, out-critical-value-k/m-b/b |
Example: ./check_traffic.sh-v 2c-c public-h 127.0.0.1-i 4-w 200,100-c 300,200-k-B |
we can use-r to use Range Value Options: Span style= "FONT-FAMILY:CALIBRI;" >example: if you don t use-k/m-b/b options , default-k-B, corresponding to Kbps |
Make sure, the check interval greater than 5 Seconds. Or Modify the Min_interval var in this file line 180. And, if you want in Verbose mode, use-v, to check the debug messages in the file/tmp/check_traffic.$$. Or use./check_traffic.sh [-v]-V 1|2c|3-c snmp-community-h host-l To list all interfaces on specify host. |
2 WindowsClient-side settings
In this example, using Windows 192.168.19.142,IP is the example.
2.1InstallationSNMPService
In Windows 2008, you can add the SNMP service by adding feature, and see the attached documentation for detailed procedures.
and Windows2003 is installed in Control Panel-Add Remove Program-add remove component-management and monitoring Tools of the SNMP service.
2.2ConfigurationSNMPService
Using services.msc to start the service console, set the SNMP Community traps and securityas follows: (see attached documentation for detailed configuration)
Then restart the SNMP service, you can use cmdànetstat–an | find "161" to verify the SNMP service startup situation
3 NagiosSettings for the server3.1InstallationNet-snmpThe related components
# yum Install–y net-snmp*
3.2Editcommand.cfgFile
vi/usr/local/nagios/etc/object/command.cfg Add the following content:
Define Command{ Command_name Check_bandwidth Command_line $USER 1$/check_traffic.sh-v 2c-c snmp-community-h $HOSTADDRESS $-I $ARG 1$-w $ARG 2$, $ARG 3$-C $ARG 4$, $AR g5$ } Note: the-C parameter is the community value set on the server; -I is uppercase I, which is the index value of the NIC interface The two parameters of- w and- c are in/out traffic thresholds, respectively |
3.3Editwindows.cfgHost configuration file
First, use the following command to view the network card information for the monitored Windows Host:
/usr/local/nagios/libexec/check_traffic.sh-v 2c-c snmp-community-h ipadd-l
Then it will list the network card information of the monitored machine, check the network card that needs to be monitored, and record its index value.
As shown in the previous example, the command is:
/usr/local/nagios/libexec/check_traffic.sh-v 2c-c public1-h 192.168.19.142–l as shown: (Picture in attachment document)
VI windows.cfg Add the following:
Define Service{ Use Generic-service HOST_NAME Winserver Service_description Traffic Check_command check_bandwidth!10!200000!300000!400000!500000 } Here is the index value of the NIC information, which is viewed by the command above: |
Then restart the nagios service.
You can also view the flow monitoring of the waveform diagram if you have PnP installed.
Nagios monitors windows for network card traffic