service monitoring in dual fail over servers

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
padu_3891
Posts: 50
Joined: Thu Sep 05, 2013 10:12 pm

service monitoring in dual fail over servers

Post by padu_3891 »

Hello Team ,

I have situation here that i want to monitor set of services for monitoring an application in HostA or HostB . Host A and B are kind of fail over environment , i mean the application will be running at any one of the host at a time . Application will be switched to other server automatically when the currentserver is down .

Is there any idea to have both the server IP for a single host and then we can have all the services mapped to this new comman host .

Service should check the host which have the application up .
bolson

Re: service monitoring in dual fail over servers

Post by bolson »

Hello,

Can you please provide more information, ie: what OS? What application? What mechanism for "failing over" to HostB? and what version of Nagios Core?

Thank you!
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: service monitoring in dual fail over servers

Post by tgriep »

You could use the plugin called check_multi and it could be configured to generate an alert when both of the services are down on both hosts if that is what you are looking for.
https://exchange.nagios.org/directory/P ... ti/details
Take a look at it and see if this is what you are looking for.
Else, you can search that site for another plugin.
Be sure to check out our Knowledgebase for helpful articles and solutions!
padu_3891
Posts: 50
Joined: Thu Sep 05, 2013 10:12 pm

Re: service monitoring in dual fail over servers

Post by padu_3891 »

Sorry for delay in repond .

The above link provided explains about the chek..but the download URL is not working . i think this check is been removed .
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: service monitoring in dual fail over servers

Post by mcapra »

Here's the github page for check_multi in case the previous website isn't working for you:
https://github.com/flackem/check_multi
Former Nagios employee
https://www.mcapra.com/
User avatar
Pitone_Maledetto
Posts: 69
Joined: Fri Jul 01, 2016 4:11 am
Location: Liverpool, United Kingdom

Re: service monitoring in dual fail over servers

Post by Pitone_Maledetto »

Hi,
you could use custom macros.
I have this setup so I can check the ILO and the host in the same host configuration.
host_address ip_of_server_A
_serverB_ip ip_of_server_B

You need to configure the service and commands to suite this configuration but works pretty good.

If you reckon that this is a good solution for you I could provide some configuration examples.

Regards

Sent from the mobile client - Forum Talker
"It is impossible to work in information technology without also engaging in social engineering"
Jaron Lanier
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: service monitoring in dual fail over servers

Post by tmcdonald »

Thanks for the assist, @Pitone_Maledetto!
Former Nagios employee
User avatar
Pitone_Maledetto
Posts: 69
Joined: Fri Jul 01, 2016 4:11 am
Location: Liverpool, United Kingdom

Re: service monitoring in dual fail over servers

Post by Pitone_Maledetto »

@tmcdonald you are welcome :)

just an example of how I would roughly make it work.

Command definition

Code: Select all

# 'check_load_ssh'
define command{
        command_name    check_serverB_load
        command_line    $USER1$/check_by_ssh -H $_HOSTBADDRESS$ -l your_log_name -C "/usr/lib/nagios/plugins/check_load -w $ARG1$ -c $ARG2$"
    }
Host definition

Code: Select all

define host{
        use                     generic-host
        host_name               serverA
        alias                   serverA and serverB
        hostgroups              your_hostgroup
        address                 serverA_ip
        _BADDRESS               serverB_ip
}
Service definition

Code: Select all

# LOAD CHECK
define service {
        use                             generic-service
        name                            serverB_Load
        service_description             serverB Load
        check_command                   check_serverB_load!7.2,5.6,4.8!8,6.4,5.6
        normal_check_interval           5
        notification_interval           10
        notification_options            w,c,r
        }
"It is impossible to work in information technology without also engaging in social engineering"
Jaron Lanier
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: service monitoring in dual fail over servers

Post by tacolover101 »

as another side note, why not assign a VIP between your active / passive services and then monitor the VIP?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: service monitoring in dual fail over servers

Post by dwhitfield »

@padu_3891, did you have any other questions or are we ready to lock this up?
Locked