Page 4 of 5

Re: how can monitor MQ with nagios

Posted: Mon Feb 08, 2016 4:47 pm
by baber
excuse me i have many searched on net and doc but could not anything clearly can you explain more

for example if i add this line to command.cfg

Code: Select all

define command {
       command_name                             notify-host-by-tcp
       command_line                             /usr/local/nagios/libexec/yourscript $NOTIFICATIONTYPE$ $HOSTNAME$ $HOSTSTATE$ $HOSTADDRESS$ $HOSTOUTPUT$ $LONGDATETIME$
}
please help me about script i have some script here would you see these scripts ? and do you think which of them is better for me ?

https://exchange.nagios.org/directory/P ... Generic%29

2 - there is not any plugin or ..... for send notification as string txt to a define host with define port number ?

Please help me i am so confused and this is so important for me just send notification as string txt to a define host on tcp port number

so thanks
Best regards

Re: how can monitor MQ with nagios

Posted: Mon Feb 08, 2016 4:58 pm
by rkennedy
The scripts you linked are to do TCP / UDP checks. They are not any plugins for sending data as a notification.

Can you please outline what you're trying to accomplish?

Re: how can monitor MQ with nagios

Posted: Mon Feb 08, 2016 5:04 pm
by baber
i just want the alaram for example i have attached it send from nagios server(10.0.0.0) to the other server(10.0.0.1) on a define port number (tcp port )


Best regards
Babak

Re: how can monitor MQ with nagios

Posted: Mon Feb 08, 2016 5:36 pm
by Box293
baber wrote:on a define port number (tcp port )
Can you explain this in more detail.
What port number?
Is there a specific application listening?

Re: how can monitor MQ with nagios

Posted: Mon Feb 08, 2016 5:48 pm
by baber
On My second server is a listener when send a string txt on port 8899 it will automatically send that string to my mobile number i just want send that alaram appear on nagios page to second server on port8899

Please help me
So thanks

Best regards

Re: how can monitor MQ with nagios

Posted: Mon Feb 08, 2016 5:53 pm
by rkennedy
Can you write a script that sends to the data to port 8899? This is what needs to be done. As stated above, here's the information you will need to pass to your script, which will send it -

Code: Select all

$NOTIFICATIONTYPE$ $HOSTNAME$ $HOSTSTATE$ $HOSTADDRESS$ $HOSTOUTPUT$ $LONGDATETIME$

Re: how can monitor MQ with nagios

Posted: Mon Feb 08, 2016 5:56 pm
by baber
There is not any script for do this job?

Have to write new script?

Re: how can monitor MQ with nagios

Posted: Mon Feb 08, 2016 8:20 pm
by Box293
Unfortunately it appears you have to write your own script. This is the power of Nagios, it allows you to do what you want HOWEVER some things require you to create the scripts to do them.

You could try looking on the Nagios Exchange for such a script that someone else has already written:
https://exchange.nagios.org/

Re: how can monitor MQ with nagios

Posted: Tue Feb 09, 2016 4:26 am
by baber
my problem is :

now nagios can send notification or alarm to mail server now i want send alaram to other server except mail server

can do it ?

Re: how can monitor MQ with nagios

Posted: Tue Feb 09, 2016 10:46 am
by rkennedy
Sure, you should be able to use event _handlers which are triggered every time a state changes (OK -> WARNING, WARNING -> OK, OK -> CRIT, CRIT -> OK, etc.)

You can have it run a script of your own whenever one of those changes, here's a bit more info about event handlers -
https://assets.nagios.com/downloads/nag ... dlers.html