Page 1 of 1

Could not open input file: /check_hpjd_new.php

Posted: Mon Mar 31, 2014 9:28 am
by aford5
I am trying to get this plugin working but I can't seem to get past this on the Service State Information page

Could not open input file: /check_hpjd_new.php

I have made sure php is set up. I checked the nagios permissions for the file. I restarted both the nagios and apache2 services. But I am out of clues as to how to get nagios to read the plugin

Re: Could not open input file: /check_hpjd_new.php

Posted: Mon Mar 31, 2014 9:30 am
by tmcdonald
Can you verify the permissions for us here please? Also can we see the service and command definitions using that plugin?

Re: Could not open input file: /check_hpjd_new.php

Posted: Mon Mar 31, 2014 9:43 am
by aford5

Code: Select all

-rwxr-xr-x 1 nagios nagios   5556 Nov 27 14:19 check_hpjd_new.php
Here is one of the lines out of the printers.cfg file

Code: Select all

 define service{
        use                     generic-service         ; Inherit values from a template
        host_name                       OutsideHPPrinter                ; The name of the host the service is associated with
        service_description     Printer Status          ; The service description
        check_command           check_hpjd_new!-C public        ; The command used to monitor the service
        normal_check_interval   10      ; Check the service every 10 minutes under normal conditions
        retry_check_interval    1       ; Re-check the service every minute until its final/hard state is determined
        } 
and the command

Code: Select all

 define command{
command_name check_hpjd_new
command_line php $USER1$/check_hpjd_new.php $HOSTADDRESS$ public 10 5
} 

Re: Could not open input file: /check_hpjd_new.php

Posted: Mon Mar 31, 2014 9:57 am
by slansing
You are likely going to have to define a "-H" before the hostaddress as just about every other plugin uses, I suggest you take a look at how some other commands are defined which are ran directly from the nagios server. The command should look something like this:

Code: Select all

command_line php $USER1$/check_hpjd_new.php -H $HOSTADDRESS$ $ARG1$

And in the service:

Code: Select all

check_command check_hpjd_new!-C public -w 10 -c 5
Please use code wraps as I did above... Also, please attach the plugin you are using.