Hi,
I am new to the Nagios monitoring.
I have implemented Nagios core and have following questions
1. Is there any way we can run custom event handler script on remote host using event_handler option while defining a service.
while testing it looks like script runs on local Nagios core server and not on remote host
2. Also any ways to add custom notification in contacts instead of email
The intention is to run custom script instead of sending mail using email option in contacts
custom notification/event_handler in Nagios Core
-
- Posts: 2
- Joined: Wed May 05, 2021 12:28 pm
Re: custom notification/event_handler in Nagios Core
Your understanding is correct; Out-of-the-box, Nagios Core runs every command (event handlers included) local to the Nagios Core daemon.sudhir.gimonkar wrote:1. Is there any way we can run custom event handler script on remote host using event_handler option while defining a service.
while testing it looks like script runs on local Nagios core server and not on remote host
You certainly could leverage a command definition that executes something on a separate system via NRPE, NCPA, or SSH. You'd be leveraging a Nagios Plugin to handle that remote communication in every case -- check_nrpe, check_ncpa, check_by_ssh, etc. Nagios Core doesn't manage remote connections by itself.
You can set any arbitrary number of addressn values in your contact definition:sudhir.gimonkar wrote:2. Also any ways to add custom notification in contacts instead of email
The intention is to run custom script instead of sending mail using email option in contacts
https://assets.nagios.com/downloads/nag ... ml#contact
And reference them in your notification handler using the $CONTACTADDRESSn$ macro:
https://assets.nagios.com/downloads/nag ... actaddress
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- Posts: 2
- Joined: Wed May 05, 2021 12:28 pm
Re: custom notification/event_handler in Nagios Core
Thanks mcapra for your response
Do you need define similar to below in service defination ? I use ping which has related plugin in /usr/local/ncpa/plugins on remote server ?
check_command check_ncpa!-t '' -P 5693 -M 'plugins/check_ping/-H <remote hostname> -a <arguments>'
Also for the comment below I not quite sure how to add the defination. If you could you please give me some example that would be really helpful
You can set any arbitrary number of addressn values in your contact definition:
https://assets.nagios.com/downloads/nag ... ml#contact
And reference them in your notification handler using the $CONTACTADDRESSn$ macro:
https://assets.nagios.com/downloads/nag ... actaddress
Again thanks for you help
Do you need define similar to below in service defination ? I use ping which has related plugin in /usr/local/ncpa/plugins on remote server ?
check_command check_ncpa!-t '' -P 5693 -M 'plugins/check_ping/-H <remote hostname> -a <arguments>'
Also for the comment below I not quite sure how to add the defination. If you could you please give me some example that would be really helpful
You can set any arbitrary number of addressn values in your contact definition:
https://assets.nagios.com/downloads/nag ... ml#contact
And reference them in your notification handler using the $CONTACTADDRESSn$ macro:
https://assets.nagios.com/downloads/nag ... actaddress
Again thanks for you help