check_iftraffic64 (No output on stdout) stderr:
Posted: Sat Jan 07, 2017 12:33 pm
I want to use check_iftraffic64 with pnp4nagios on Nagios core.
But after I tried to apply service check_iftrafic, at 'Status Information' on Service page, it show "(No output on stdout) stderr:"

It's weird, because I can get the output from original check_iftraffic64.pl
I was done
chown -R nagios:nagios check_iftraffic64.pl
chmod 750 check_iftraffic64.pl
This is verify
This is I'd done with commands.cfg
This is I'd done with switch.cfg
This is from resource.cfg
This is how to use check_iftraffic64
A switch is Cisco Catalyst 2960-X. I use Nagios Core 4.2.4, Nagios Plugin 2.1.4, PNP4Nagios-0.6.25.
Please help me
I had attach nagios.cfg. If want any file or verify more please tell me.
Thank you very much.
But after I tried to apply service check_iftrafic, at 'Status Information' on Service page, it show "(No output on stdout) stderr:"

It's weird, because I can get the output from original check_iftraffic64.pl
Code: Select all
[root@osboxes etc]# /usr/local/nagios/libexec/check_iftraffic64.pl -H 192.168.99.253 -C <XXXXXX> -i GigabitEthernet1/0/1 -r -b 1000 -u m -B -f
OK - Average IN: 132.08b (0.00%), Average OUT: 515.28b (0.00%)Total RX: 464.00Mbits, Total TX: 4.54Gbits|inUsage=0.00%;85;98 outUsage=0.00%;85;98 inBandwidth=16.51B outBandwidth=64.41B inAbsolut=57999689c outAbsolut=567085849c
chown -R nagios:nagios check_iftraffic64.pl
chmod 750 check_iftraffic64.pl
Code: Select all
[root@osboxes etc]# ls -l /usr/local/nagios/libexec/check_iftraffic64.pl
-rwxr-x---. 1 nagios nagios 39106 Jan 6 02:53 /usr/local/nagios/libexec/check_iftraffic64.pl
Code: Select all
[root@osboxes etc]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 15 services.
Checked 3 hosts.
Checked 2 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 27 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 3 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
[root@osboxes etc]# perl ~/verify_pnp_config --mode bulk+npcd --config=/usr/local/nagios/etc/nagios.cfg --pnpcfg=/usr/local/pnp4nagios/etc
[INFO] ========== Starting Environment Checks ============
[INFO] My version is: verify_pnp_config-0.6.25-R.40
[INFO] Start Options: /root/verify_pnp_config --mode bulk+npcd --config=/usr/local/nagios/etc/nagios.cfg --pnpcfg=/usr/local/pnp4nagios/etc
[INFO] Reading /usr/local/nagios/etc/nagios.cfg
[OK ] Running product is 'nagios'
[OK ] object_cache_file is defined
[OK ] object_cache_file=/usr/local/nagios/var/objects.cache
[INFO] Reading /usr/local/nagios/var/objects.cache
[OK ] resource_file is defined
[OK ] resource_file=/usr/local/nagios/etc/resource.cfg
[INFO] Reading /usr/local/nagios/etc/resource.cfg
[INFO] Reading /usr/local/pnp4nagios/etc/process_perfdata.cfg
[INFO] Reading /usr/local/pnp4nagios/etc/pnp4nagios_release
[OK ] Found PNP4Nagios version "0.6.25"
[OK ] Effective User is 'nagios'
[OK ] User nagios exists with ID '1001'
[OK ] Effective group is 'nagios'
[OK ] Group nagios exists with ID '1001'
[INFO] ========== Checking Bulk Mode + NPCD Config ============
[OK ] process_performance_data is 1 compared with '/1/'
[OK ] service_perfdata_file is defined
[OK ] service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
[OK ] service_perfdata_file_template is defined
[OK ] service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECH$
[OK ] PERFDATA template looks good
[OK ] service_perfdata_file_mode is defined
[OK ] service_perfdata_file_mode=a
[OK ] service_perfdata_file_processing_interval is defined
[OK ] service_perfdata_file_processing_interval=15
[OK ] service_perfdata_file_processing_command is defined
[OK ] service_perfdata_file_processing_command=process-service-perfdata-file
[OK ] host_perfdata_file is defined
[OK ] host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
[OK ] host_perfdata_file_template is defined
[OK ] host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$
[OK ] PERFDATA template looks good
[OK ] host_perfdata_file_mode is defined
[OK ] host_perfdata_file_mode=a
[OK ] host_perfdata_file_processing_interval is defined
[OK ] host_perfdata_file_processing_interval=15
[OK ] host_perfdata_file_processing_command is defined
[OK ] host_perfdata_file_processing_command=process-host-perfdata-file
[INFO] Nagios config looks good so far
[INFO] ========== Checking config values ============
[OK ] npcd daemon is running
[OK ] /usr/local/pnp4nagios/etc/npcd.cfg is used by npcd and readable
[INFO] Reading /usr/local/pnp4nagios/etc/npcd.cfg
[OK ] perfdata_spool_dir is defined
[OK ] perfdata_spool_dir=/usr/local/pnp4nagios/var/spool
[OK ] 2 files found in /usr/local/pnp4nagios/var/spool
service_perfdata_file_processing_command at /root/verify_pnp_config line 462.
[OK ] Command process-service-perfdata-file is defined
[OK ] '/bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$'
[OK ] Command looks good
host_perfdata_file_processing_command at /root/verify_pnp_config line 462.
[OK ] Command process-host-perfdata-file is defined
[OK ] '/bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$'
[OK ] Command looks good
[OK ] Script /usr/local/pnp4nagios/libexec/process_perfdata.pl is executable
[INFO] ========== Starting global checks ============
[OK ] status_file is defined
[OK ] status_file=/usr/local/nagios/var/status.dat
[INFO] host_query =
[INFO] service_query =
[INFO] Reading /usr/local/nagios/var/status.dat
[INFO] ==== Starting rrdtool checks ====
[OK ] RRDTOOL is defined
[OK ] RRDTOOL=/bin/rrdtool
[OK ] /bin/rrdtool is executable
[OK ] RRDtool 1.4.8 Copyright 1997-2013 by Tobias Oetiker <[email protected]>
[OK ] USE_RRDs is defined
[OK ] USE_RRDs=1
[OK ] Perl RRDs modules are loadable
[INFO] ==== Starting directory checks ====
[OK ] RRDPATH is defined
[OK ] RRDPATH=/usr/local/pnp4nagios/var/perfdata
[OK ] Perfdata directory '/usr/local/pnp4nagios/var/perfdata' exists
[WARN] 4 hosts/services are not providing performance data
[WARN] 'process_perf_data 1' is set for 5 hosts/services which are not providing performance data!
[OK ] 'process_perf_data 1' is set for 19 of your hosts/services
[INFO] ==== System sizing ====
[OK ] 18 hosts/service objects defined
[INFO] ==== Check statistics ====
[WARN] Warning: 2, Critical: 0
[WARN] Checks finished...Code: Select all
'check_iftraffic' command definition
define command{
command_name check_iftraffic64
command_line $USER1$/check_iftraffic64.pl -H $HOSTADDRESS$ -C $ARG1$ -i $ARG2$ -r -b 1000 -u m -B -f
}
Code: Select all
define host{
use generic-switch,host-pnp ; Inherit default values from a template
host_name NPRDPUKHASW01 ; The name we're giving to this switch
alias NPRDPUKHASW01 Switch ; A longer name associated with the switch
address 192.168.99.253 ; IP address of the switch
hostgroups switches ; Host groups this switch is associated with
}
define service {
use generic-service,srv-pnp ; Inherit values from a template
host_name NPRDPUKHASW01
service_description Gi1/0/3 Traffic Load
check_command check_iftraffic64!<XXXXXX>!GigabitEthernet1/0/3
max_check_attempts 3
normal_check_interval 5
retry_check_interval 5
}
Code: Select all
# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/local/nagios/libexec
Code: Select all
[root@osboxes libexec]# ./check_iftraffic64.pl
Missing host address!
Usage: check_iftraffic64.pl -H host [ -C community_string ] [ -i if_index|if_descr ] [ -r ] [ -b if_max_speed_in | -I if_max_speed_in ] [ -O if_max_speed_out ] [ -u ] [ -B ] [ --32bit ] [ -f ] [ -A IP Address ] [ -L ] [ -M ] [ -w warn ] [ -c crit ] [ -v 1|2|3 ] [ --username <username> ] [ --authpassword <authpassword> ] [ --authprotocol MD5|SHA ] [ --privpassword <privpassword> ] [ --privprotocol DES|AES|3DES ]
Example 1: check_iftraffic64.pl -H host1 -C sneaky
Example 2: check_iftraffic64.pl -H host1 -C sneaky -i "Intel Pro" -r -B
Example 3: check_iftraffic64.pl -H host1 -C sneaky -i 5
Example 4: check_iftraffic64.pl -H host1 -C sneaky -i 5 -B -b 100 -u m --32bit
Example 5: check_iftraffic64.pl -H host1 -C sneaky -i 5 -B -I 20 -O 5 -u m
Example 6: check_iftraffic64.pl -H host1 -C sneaky -A 192.168.1.1 -B -b 100 -u m
Example 7: check_iftraffic64.pl -H host1 -C sneaky -A 192.168.1.1 --force --32bit
Example 8: check_iftraffic64.pl -H host1 --username admin --authpassword sneaky
Example 9: check_iftraffic64.pl -H host1 --username admin --authpassword sneaky123 --privpassword reallysneaky --privprotocol 3DES
Options:
-b, --bandwidth INTEGER
-I, --inBandwidth INTEGER
Interface maximum speed in kilo/mega/giga/bits per second. Applied to
both IN and OUT if out (-O) max speed is not provided. Requires -u.
-O, --outBandwidth INTEGER
Interface maximum speed in kilo/mega/giga/bits per second. Applied to
OUT traffic. Uses the same units value given for -b. Requires -u.
-i, --interface STRING
Interface Name
-M, --max INTEGER
Max Counter Value (in bits) of net devices in giga/mega/kilo/bits. Requires -u.
-r, --regexp
Use regexp to match NAME in description OID
-u, --units STRING
g=gigabits/s,m=megabits/s,k=kilobits/s,b=bits/s. Required if -b, -I, -M,
or -O are used.
-A, --address STRING (IP Address)
IP Address to use when determining the interface index to use. Can be
used when the index changes frequently or as in the case of Windows
servers the index is different depending on the NIC installed.
-C, --community STRING
SNMP Community.
-H, --host STRING or IPADDRESS
Check interface on the indicated host.
-c, --critical INTEGER
% of bandwidth usage necessary to result in critical status (default: 98%)
-w, --warning INTEGER
% of bandwidth usage necessary to result in warning status (default: 85%)
--32bit FLAG
Set to use 32 bit counters instead of 64 bit (default: 64 bit).
-B, --bits FLAG
Display results in bits per second b/s (default: Bytes/s)
-f, --force FLAG
Set to force either 64 bit or 32 bit only checking (32 bit requires --32bit flag).
-d, --debug INTEGER
Output some debug info, not supported inside of Nagios but may be useful
from the command line. Levels 1-4 can be specified, 4 being the most information.
-h, --help
Displays this help text
-L, --list FLAG (on/off)
Tell plugin to list available interfaces. This is not supported inside
of Nagios but may be useful from the command line.
-v, --Version STRING
Set SNMP version (defaults to 2). Version 2 or 3 required for 64 bit counters.
--authpassword STRING
Set v3 authorization password.
--authprotocol STRING
Set v3 authorization protocol (default: MD5).
--privpassword STRING
Set v3 privilege (encryption) string.
--privprotocol STRING
Set v3 privilege (encryption) protocol (default: DES).
1
Please help me
I had attach nagios.cfg. If want any file or verify more please tell me.
Thank you very much.