I first start coping a large file to create network traffic.
From the command line, note that I have output for bytes_in and bytes_out and notice the [R] is part the interface name.
Code: Select all
# ./check_win_net_usage.sh -H test1 -i "Intel[R] PRO_1000 MT Network Connection" -o MB
Network OK - 0 MBytes received/sec, 0 MBytes sent/sec|bytes_in=342;bytes_out=60
If I don't have the syntax correct, I do not receive an error, instead I just get the input and output is zero.
Command Config
Code: Select all
define command {
command_name check_net_traffic_win
command_line $USER1$/check_win_net_usage.sh -H $HOSTADDRESS$ -i $ARG1$ -o $ARG2$
}
Code: Select all
define service {
host_name test1
service_description Network_Traffic
use st_check_60_auto_ack__24x7
check_command check_net_traffic_win!"Intel"[R]" PRO_1000 MT Network Connection"!MB!!!!!!
register 1
}
Code: Select all
Testing check from command line...
COMMAND: /usr/local/nagios/libexec/check_win_net_usage.sh -H test1 -i "Intel"\[R\]" PRO_1000 MT Network Connection" -o MB
OUTPUT: Network OK - 0 MBytes received/sec, 0 MBytes sent/sec|bytes_in=406;bytes_out=60
Code: Select all
Network OK - 0 MBytes received/sec, 0 MBytes sent/sec
Don