Could not open input file: /check_hpjd_new.php

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
aford5
Posts: 2
Joined: Mon Mar 31, 2014 9:08 am

Could not open input file: /check_hpjd_new.php

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post by tmcdonald »

Can you verify the permissions for us here please? Also can we see the service and command definitions using that plugin?
Former Nagios employee
aford5
Posts: 2
Joined: Mon Mar 31, 2014 9:08 am

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

Post 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
} 
Last edited by aford5 on Mon Mar 31, 2014 10:21 am, edited 1 time in total.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post 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.
Locked