[Nagiosplug-help] check_procs - integer error

Thomas Guyot-Sionnest dermoth at aei.ca
Thu May 1 14:52:54 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Please re-read my first answer, the answer is there (hint: you don't
have any $ARGn$ macro in your command definitions).

If you still have trouble understanding you can read Nagios
documentation as well.

http://nagios.sourceforge.net/docs/2_0/xodtemplate.html#command

Thomas

On 01/05/08 08:07 AM, secrookie at gmail.com wrote:
> I tried tired this:
> 
> $USER5$=/usr/local/nagios/var/nagios.dat
> $USER6$=/usr/local/nagios/bin/nagios
> 
> # 'check_nagios' command definition
> define command{
>         command_name    check_nagios
>         command_line    $USER1$/check_nagios -e 5 -F $USER5$ -C $USER6$
>         }
> 
> define service{
>         use                             local-service         ; Name
> of service template to use
>         host_name                       localhost
>         service_description             nagios
>         check_command                   check_nagios!-e!5!-F!$USER5$!-C!$USER6$
>         notifications_enabled           0
>        }
> 
> But get: NAGIOS CRITICAL: Cannot open status log for reading!
> 
> Running from the shell works fine.
> 
> # /usr/local/nagios/libexec/./check_nagios -e 5 -F
> /usr/local/nagios/var/status.dat -C /usr/local/nagios/bin/nagios
> NAGIOS OK: 1 process, status log updated 5 seconds ago
> 
> Thanks for the help.
> 
> regards,
> secrookie
> 
> 2008/5/1 Thomas Guyot-Sionnest <dermoth at aei.ca>:
>> -----BEGIN PGP SIGNED MESSAGE-----
>>  Hash: SHA1
>>
>>
>>
>>  On 30/04/08 11:09 PM, secrookie at gmail.com wrote:
>>  > I have 2 checks defined, they run but the status info is showing that
>>  > it must be an integer:
>>  >
>>  > define service{
>>  >         use                             local-service         ; Name
>>  > of service template to use
>>  >         host_name                       localhost
>>  >         service_description             syslog2mysql
>>  >         check_command
>>  > check_local_procs!-w!1!-a!syslog2mysql.sh!-u!root
>>  >         notifications_enabled           0
>>  >         }
>>  >
>>  > define service{
>>  >         use                             local-service         ; Name
>>  > of service template to use
>>  >         host_name                       localhost
>>  >         service_description             nagios
>>  >         check_command
>>  > check_nagios!-e!5!-F!/usr/local/nagios/var/status.dat!-C!/usr/local/nagios/bin/nagios
>>  >         notifications_enabled           0
>>  >         }
>>  >
>>  > The checks run find via command line:
>>  >
>>  > PROCS OK: 1 process with args 'syslog2mysql.sh', UID = 0 (root)
>>  > NAGIOS OK: 1 process, status log updated 6 seconds ago
>>
>>  The arguments you put in the service definition between bangs (!) are
>>  not sent directly to the plugin. They are rather being expanded to
>>  $ARGn$ macros (starting at $ARG1$) in the command definition. The
>>  command definition can have use other macros instead of passing
>>  arguments, like $HOSTADDRESS$ for network-based checks.
>>
>>  Example (from Nagios doc) of a command that will require no argument
>>  from the service definition:
>>
>>  define command{
>>   command_name  check_pop
>>   command_line  /usr/local/nagios/libexec/check_pop -H $HOSTADDRESS$
>>   }
>>
>>  Here's a list of macros for Nagios 2 (a similar list exists for Nagios 3
>>  if you use it):
>>  http://nagios.sourceforge.net/docs/2_0/macros.html
>>
>>  Thomas
>>  -----BEGIN PGP SIGNATURE-----
>>  Version: GnuPG v1.4.6 (GNU/Linux)
>>  Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>>  iD8DBQFIGXyO6dZ+Kt5BchYRAkRkAKCrS1a2TGOzt4EydCXUpCo3TN6RIwCfazLT
>>  zUu8AvZ4SjTNTqL9sJcqtzg=
>>  =2JWm
>>  -----END PGP SIGNATURE-----
>>
> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIGb0l6dZ+Kt5BchYRAsMfAJ92vFDwSRHN/c/OevrOmxwHYC9TEwCgpQ8i
PueqJx2E/K+F8fB1DsuPRbk=
=85EJ
-----END PGP SIGNATURE-----




More information about the Help mailing list