HOSTSTATETYPE problem

Tomáš Macek maca02 at atlas.cz
Tue Oct 11 09:10:27 CEST 2005


Hi, I'm writing an event handler in C. I have this code:

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]);

...

}


My /etc/nagios/commands.cfg contains this line:

	command[resetOutletSVIt]=$USER1$/routlet 192.168.1.1 1 $HOSTSTATETYPE$

My /etc/nagios/hosts.cfg contains this:
	host[ip1]=IP do  
ven;192.168.1.2;;check-host-alive;5;60;24x7;1;1;0;resetOutletSVIt

and the /var/log/messages contains this line, when the event is run:

	Oct  7 12:21:45 iks routlet: outlet: '192.168.1.1' '1' '$'

Why the "$"??? It should contain the text like "SOFT" or "HARD",  
shlouldn't it?

Any help appreciated!


-------------------------------------------------------
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