HOSTSTATETYPE problem

Andreas Ericsson ae at op5.se
Mon Oct 10 09:57:28 CEST 2005


Tomas Macek wrote:
> Hi, I have this piece of main.c of my nagios plugin:
> 
> ---------------------------------------------
> int main(int argc, char *argv[]) {
>      netsnmp_pdu *response;
>      oid anOID[MAX_OID_LEN];
>      size_t anOID_len;
>      int i = 0;
>      char ret_pass[9];
>      int status = STATE_UNKNOWN, outlet = -1;
>      struct stat st;
> 
>      if (argc < 2) {
>          printf("Usage: routlet <host> <outlet>\n\thost - host to 
> check\n\toutlet - outlet to restart");
>          return STATE_UNKNOWN;
>      }
>      syslog(LOG_NOTICE, "routlet: '%s' '%s' '%s'", argv[1], argv[2], 
> argv[3]);
> 
>      ...
>      ...
>      ...
> }
> ---------------------------------------------
> 
> and I have this [command] line in my nagios config file 
> /etc/nagios/commands.cfg:
> 
> --------------------
> command[resetOutletSVIt]=$USER1$/routlet 192.168.1.1 5 $HOSTSTATETYPE$
> --------------------
> 
> And finally - this is output in the /var/log/messages file when the 
> plugin was run:
> 
> -------------------
> routlet: outlet: '213.250.192.60' '5' '$'
> -------------------
> 
> I'm using Nagios version 1.2. Why I got this output, when other 
> variables like $HOSTATTEMPT$ works fine?
> 
> Any help appreciated!!
> 

Read the docs on macros and make sure you get the docs version that 
corresponds to your nagios version.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list