Page 1 of 1

TCP check more than one port under one service config?

Posted: Mon Oct 16, 2017 3:17 pm
by ikekim
Hi,

When I create a service to check_tcp, I know I can use "-p 80" for $ARG1$, but would I be able to check multiple ports using the $ARG1$ parameter or $ARG2$?

$USER1$/check_tcp -H $HOSTADDRESS$ $ARG1$ and when I use "-p 80" for $ARG1$ parameter, it runs the command
$ /usr/local/nagios/libexec/check_tcp -H 10.155.58.26 -p 80

So this is good, but how can I configure to check multiple ports if that is possible.


thanks,
ik.

Re: TCP check more than one port under one service config?

Posted: Mon Oct 16, 2017 4:06 pm
by bolson
I'm sorry, that's not possible. The command takes only one argument for port number. You would check multiple ports by configuring multiple instances of the check command.

Re: TCP check more than one port under one service config?

Posted: Tue Oct 17, 2017 1:03 pm
by ikekim
Okay thanks for the response.

Perhaps, I can write my own plugin?..where would be a good place to learn about writing and creating you own customized plugin?


thanks.

Re: TCP check more than one port under one service config?

Posted: Tue Oct 17, 2017 1:27 pm
by bolson
Here's a link to a tutorial on creating a plugin using bash.

Enjoy!

Re: TCP check more than one port under one service config?

Posted: Tue Oct 17, 2017 1:56 pm
by ikekim
@bolson,

where is the link?

thanks.

Re: TCP check more than one port under one service config?

Posted: Tue Oct 17, 2017 2:03 pm
by bolson

Re: TCP check more than one port under one service config?

Posted: Tue Oct 17, 2017 3:47 pm
by ikekim
Thank you for the link.

I will see how fun this is going to be or not going to be...


ik

Re: TCP check more than one port under one service config?

Posted: Tue Oct 17, 2017 3:49 pm
by dwasswa
Thanks @ bolson.

@ikekim,let us know how it goes.