check_vnc Service check did not exit properly
Posted: Thu Oct 26, 2017 1:00 pm
I'm trying to set up a custom service check via a server group definition with a new install (as a newbie) on nagios. I found a script on the nagios website for check_vnc and installed it in my /usr/lib/nagios/plugins (manually)
I then created a new vnc.cfg under /etc/nagios-plugins/config/vnc.cfg:
I added the following hostgroup definition to my /etc/nagios3/conf.d/hostgroups_nagios2.cfg file:
then added the service definition to /etc/nagios3/conf.d/services_nagios2.cfg:
The host itself is defined in /etc/nagios3/conf.d/localhost_nagios2.cfg:
When I restart the server, it reports a critical error for:
VNC CRITICAL 2017-10-26 13:50:28 0d 0h 27m 21s 4/4 (Service check did not exit properly)
When I execute it from the command line, it seems to behave just fine:
I then created a new vnc.cfg under /etc/nagios-plugins/config/vnc.cfg:
Code: Select all
# cat /etc/nagios-plugins/config/vnc.cfg
# 'check_vnc' command definition
define command{
command_name check_vnc
command_line /usr/lib/nagios/plugins/check_vnc -H '$HOSTADDRESS$'
}
# 'check_vnc_port' command definition
define command{
command_name check_vnc_port
command_line /usr/lib/nagios/plugins/check_vnc -p '$ARG1$' -H '$HOSTADDRESS$'
}
Code: Select all
define hostgroup {
hostgroup_name vnc-servers
alias VNC servers
members localhost
}
Code: Select all
define service {
hostgroup_name vnc-servers
service_description VNC
check_command check_vnc
use generic-service
notification_interval 0 ; set > 0 if you want to be renotified
}
Code: Select all
define host{
use generic-host ; Name of host template to use
host_name localhost
alias localhost
address 127.0.0.1
}
VNC CRITICAL 2017-10-26 13:50:28 0d 0h 27m 21s 4/4 (Service check did not exit properly)
When I execute it from the command line, it seems to behave just fine:
Code: Select all
# /usr/lib/nagios/plugins/check_vnc -H localhost
VNC OK - RFB version 003.008 | time=0.069626s;;
# sudo -u www-data /usr/lib/nagios/plugins/check_vnc -H 127.0.0.1
VNC OK - RFB version 003.008 | time=0.065526s;;
# echo $?
0