Page 1 of 1

check_vnc Service check did not exit properly

Posted: Thu Oct 26, 2017 1:00 pm
by treii28
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:

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$'
        }
I added the following hostgroup definition to my /etc/nagios3/conf.d/hostgroups_nagios2.cfg file:

Code: Select all

define hostgroup {
        hostgroup_name  vnc-servers
        alias           VNC servers
        members         localhost
        }
then added the service definition to /etc/nagios3/conf.d/services_nagios2.cfg:

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
        }
The host itself is defined in /etc/nagios3/conf.d/localhost_nagios2.cfg:

Code: Select all

define host{
        use                     generic-host            ; Name of host template to use
        host_name               localhost
        alias                   localhost
        address                 127.0.0.1
        }
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:

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

Re: check_vnc Service check did not exit properly

Posted: Thu Oct 26, 2017 4:55 pm
by treii28
OK, I eventually figured out that apparently that check_vnc plugin isn't compliant. (changing from using the embedded perl interpreter to the global one seems to have made that one work)

But now I'm getting the 0 bytes received errors for anything checked via check_nrpe and none of my check_nrpe!check_* items are trying to pass any variables/arguments. (I've tried it with the dont_blame_nrpe at both 0 and 1 with the same result)

Re: check_vnc Service check did not exit properly

Posted: Fri Oct 27, 2017 1:02 pm
by kyang
If this is an NRPE related issue, I would ask you to create a new thread about NRPE. That way we aren't mixing two topics into one. I can move it into a new topic when I see a response.

Did nrpe work prior to your issue on check_vnc?

Re: check_vnc Service check did not exit properly

Posted: Fri Nov 03, 2017 7:00 am
by tacolover101
kyang wrote:If this is an NRPE related issue, I would ask you to create a new thread about NRPE. That way we aren't mixing two topics into one. I can move it into a new topic when I see a response.

Did nrpe work prior to your issue on check_vnc?
\when opening the NRPE thread, post logs from the client side, as well as the command you're using on the Nagios side, and how you have check_nrpe configured.

Re: check_vnc Service check did not exit properly

Posted: Fri Nov 03, 2017 2:48 pm
by npolovenko
@treii28, And you can include the link to this thread if you think these issues are related.