Hi Guys,
I am testing check_vmware_api.pl plugin but it is shows me an error, if I test the plugin looks like is working but when i configure the command file and added the service to the host, it shows this error on nagios gui.
Error:
Usage: check_vmware_api.pl -D
Plugin test:
root@NagiosCore4:/usr/local/nagios/libexec# ./check_vmware_api.pl -H 192.168.160.xx -u xxxx -p xxxx -l cpu
CHECK_VMWARE_API.PL OK - cpu usage=1508.00 MHz (2.90%) | cpu_usagemhz=1508.00MHz;; cpu_usage=2.90%;;
Command Define:
define command{
command_name check_vmware_api_host_cpu_usage
command_line $USER1$/check_vmware_api.pl -H $HOSTADDRESS$ -u $USER11$ -p $USER12$ -l cpu -s usage -w $ARG1$ -c $ARG2$
}
Service Define
# check_vmware_api.pl
define service{
use local-service
host_name c1b1
service_description CPU_USAGE
check_command check_vmware_api_host_cpu_usage! -H 192.168.160.xx -u xxxx -p xxxx -l cpu
}
I need some help on this.
Br,
Plugin check_vmware_api.pl error
Re: Plugin check_vmware_api.pl error
The defined command is using $ARGx$ and $USERx$ ... which means that your check command should be more along the lines of
check_command check_vmware_api_host_cpu_usage!50!60
Which would give $ARG1$ = 50 and $ARG2$ = 60 ... you may want to read the documentation on how creating check commands works here https://assets.nagios.com/downloads/nag ... acros.html
check_command check_vmware_api_host_cpu_usage!50!60
Which would give $ARG1$ = 50 and $ARG2$ = 60 ... you may want to read the documentation on how creating check commands works here https://assets.nagios.com/downloads/nag ... acros.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Plugin check_vmware_api.pl error
If you password has special chars in it, this could cause a problem, you may want to consider quoting the $USER11$ & $USER12$ vars, like so:
Code: Select all
define command{
command_name check_vmware_api_host_cpu_usage
command_line $USER1$/check_vmware_api.pl -H $HOSTADDRESS$ -u '$USER11$' -p '$USER12$' -l cpu -s usage -w $ARG1$ -c $ARG2$
}