Trigger script on critical alert

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Trigger script on critical alert

Post by absarcompass »

Hi Team,
I am just curious if there is a possibility of achieving batch/shell or windows script to run when a critical alarm occur.

Scenario:
There are two Windows Server with same IP address but only one stays alive so if we lose ping on Server 'A' the other server, 'B', should get A's IP address via script.
if it is achievable then what should be the line of action?

Any help will be appreciated :)
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Trigger script on critical alert

Post by npolovenko »

@absarcompass, This depends on what agent you're using. In NSClient you can make a script and put it into a scripts folder. Here's an example: https://assets.nagios.com/downloads/nag ... ios-XI.pdf It's not exactly what you want but it'll walk you through the process of creating and configuring a custom script to run with NSClient.
Also, I don't know the whole plan of action but implementing this technique might be a little overkill. Why not build a script locally with a simple ping command from one server to another?
Also, Nagios XI has event handler option. So you probably already monitor host A and B with XI, you can add a custom event handler script to do something when server X goes down.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
And the first link has more info on event handlers as well, if you scroll to the bottom.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked