[Nagiosplug-help] NRPE and monitoring specify port

Marcus adesperateuser at googlemail.com
Mon May 19 12:24:16 CEST 2008


jendan at tiscali.cz schrieb:
> Yeeeeaaaah, it work, thank you so much.....
Welcome.

> yet one ask......can i do that definiton for tcp universal and only define
> number of port in services.cfg?

> Now i have in commands.cfg commands
> check_tcp1, check_tcp2, check_tcp3, check_tcp4, check_tcp5 etc....and in
> this i have numbers of port, and for each service of host i use that tcp1,
> or tcp2,.....
> could i define that number of port in definiton of service??
Sure, just use $ARG1$ $ARG2$ etc, in your command definition. (See the 
fabulous manual on this issue, to clarify if needed.)


# 'check_tcp' command definition
define command{
	command_name	check_tcp
	command_line	$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
	}


in your service definition you can then use

service 1
check_command check_tcp!123

service 2
check_command check_tcp!456

The "!" is for seperating command-name and parameter.

I hope I understood right, what you are trying to do (having a 
parametrized command-definition, and give the port as a parameter).


Greetz, Marcus

P.S.:
Please don't answer to me directly but to the nagios-list, so everyone 
can profit from the solution of your problem.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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