[Nagiosplug-devel] PHP as script language for plugins

Paa.listas paa.listas at gmail.com
Sat Jul 28 17:27:27 CEST 2007


Hello,

  I am new to Nagios and more new to writing plugins for it. I am train to
code one in PHP, but I always receive this answere in the Nagios front-end:

Status Information: 		(No output returned from plugin)



The simplest plugin is this:

-------------------------------------------------
#!/usr/bin/php

<?php

printf("TFTP OK - Hello Word\n");
exit(0);

?>
-------------------------------------------------

My tftp.cfg file looks like this (I am not using the parameters right now):
-------------------------------------------------
# 'check_tftp' command definition
define command{
   command_name    check_tftp
   command_line    /usr/lib/nagios/plugins/check_tftp.real $HOSTADDRESS$
$ARG1$ $ARG2$
        }
-------------------------------------------------

And my service like this:
-------------------------------------------------
define service{
        use                             	generic-service
        host_name                       tftpHost
        service_description         TFTP Server test
        check_command             check_tftp!argument1!argument2
        }
-------------------------------------------------

There are any problems with PHP or with this code? Thanks in advance and
sorry for my bad English.

Saludos. Pablo.







More information about the Devel mailing list