writing a plugin, looking for advice on capability or other

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

writing a plugin, looking for advice on capability or other

Postby gmills » Mon Aug 12, 2019 2:55 pm

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

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

Postby mbellerue » Tue Aug 13, 2019 9:07 am

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
mbellerue
 
Posts: 405
Joined: Fri Jul 12, 2019 11:10 am

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

Postby mcapra » Tue Aug 13, 2019 2:49 pm

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
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3573
Joined: Thu May 05, 2016 3:54 pm

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

Postby mbellerue » Tue Aug 13, 2019 3:19 pm

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!
User avatar
mbellerue
 
Posts: 405
Joined: Fri Jul 12, 2019 11:10 am

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

Postby gmills » Tue Aug 13, 2019 6:09 pm

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: 57
Joined: Wed Jun 12, 2019 2:08 pm

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

Postby gmills » Tue Aug 13, 2019 6:27 pm

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

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

Postby scottwilkerson » Wed Aug 14, 2019 7:58 am

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/nagioscore/docs/externalcmds/
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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15780
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 26 guests