writing a plugin, looking for advice on capability or other

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.
Locked
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

writing a plugin, looking for advice on capability or other

Post by gmills »

I am looking at writing a plugin. what I would like to do. reason I'm asking if the Nagios team if it is feasible. thank you
or if there is already a mechanism for doing something like this?

I am thinking to ping the server, access its health.

primary | failover |
------------------------------------
up | up | |do nothing
up | down | |start environments on primary - if primary previous state is up, do nothing
down | up | |start environments on failover
down | down | |wait until next health check
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: writing a plugin, looking for advice on capability or ot

Post by mbellerue »

Hi gmills,

This sounds like it could be a challenging plugin to write. Here are a few Nagios features that may help you along the way.

Event Handlers
https://assets.nagios.com/downloads/nag ... dlers.html

Adaptive Monitoring
https://assets.nagios.com/downloads/nag ... ptive.html

Monitoring Service and Host Clusters
https://assets.nagios.com/downloads/nag ... sters.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: writing a plugin, looking for advice on capability or ot

Post by mcapra »

Really sounds like you're looking for a custom event handler rather than a traditional Nagios plugin.

But yeah, all of that sounds very doable on a basic level and even something very typical of what people generally do with event handlers.
Former Nagios employee
https://www.mcapra.com/
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: writing a plugin, looking for advice on capability or ot

Post by mbellerue »

Thanks, Matt! Yeah, this really does sound like a job for Event Handlers.

gmills, definitely let us know if there's anything else we can do to help.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

Re: writing a plugin, looking for advice on capability or ot

Post by gmills »

thanks everyone, yeah, I do think nagios Core could be used this way, I will play around with event handlers and utilize your suggestions, thank you very much. It does sound like a very kewl project/initiative, but, the more I think about it and investigate, I think I am going to ( sense it is intention is for failover of monitored servers) implement a failover solution on Linux with Linux Virtual Server or Heartbeat/Pacemaker,Corosync. I only have a 2 node cluster. But, I'm intriged by using Nagios/HA monitoring health, then issue logic.
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

Re: writing a plugin, looking for advice on capability or ot

Post by gmills »

Hey, which leads me to another Nagios Core question, :) lol, thanks

is there a way with Nagios Core to automagically switch groups of services from inactive to active, say I have around 200 services monitoring the primary server, and these are all activly monitored by Nagios Core, then a nightmare occurs and the system crashes( primary ). The failover mechanism will switch the servers services to the secondary or failover box, for however long it takes, then now I have to manually inactivate and activate the correct services monitored for the secondary host.

thanks for all your insight and suggestions,
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: writing a plugin, looking for advice on capability or ot

Post by scottwilkerson »

gmills wrote:is there a way with Nagios Core to automagically switch groups of services from inactive to active
Not automagically, but it can be done programmatically
https://assets.nagios.com/downloads/nag ... ernalcmds/

Code: Select all

DISABLE_HOSTGROUP_HOST_CHECKS
ENABLE_HOSTGROUP_HOST_CHECKS
DISABLE_HOSTGROUP_SVC_CHECKS
ENABLE_HOSTGROUP_SVC_CHECKS
There are options for SERVICEGROUPS as well
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked