New Error Code for Nagios Core

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
crkmenon
Posts: 5
Joined: Fri Apr 24, 2015 1:49 am

New Error Code for Nagios Core

Post by crkmenon »

Hi,

Today Nagios core only takes up the following return code

0 - OK
1- WARNING
2 - CRITICAL
3 - UNKNOWN

Is there a way we could have another return code to return a FATAL or CATASTROPHIC.

the need of the hour for me is to create a SEVERITY-1 ticket based on a FATAL message or return. My systems can create only a WARNING or CRITICAL situation and a corresponding SEVERITY-3 and a SEVERITY-2 tickets

Banging my head, if I could either make the plugin return a different code, but got to know that nagios can only understand the stated 4..

Any Ideas, clues, work-arounds are really appreciated.

Best Regards
Rakesh
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: New Error Code for Nagios Core

Post by tmcdonald »

This would require a pretty significant rewrite of Core (and the plugins, NRPE, XI, etc.) to handle the logic for the new states. How are you opening the tickets? If you are using an event handler you could write in some logic to parse out the messages, but that's not going to be easy.
Former Nagios employee
crkmenon
Posts: 5
Joined: Fri Apr 24, 2015 1:49 am

Re: New Error Code for Nagios Core

Post by crkmenon »

Thank you tmcdonald for your idea.

I have the nagios submit the events with the return code, to another perl script, which in turn sends the events back to the event management systems ( here in this case IBM Netcool) for ticketing. I have seen the author of the perl script modify it to make a WARNING EVENT to be submitted as CRITICAL EVENT and similarly a CRITICAL EVENT as a FATAL EVENT to netcool
but that does not solve the purpose. Each event condition that I see being modified from WARNING to CRITICAL, in the perl script, does not have a associated Severity-3 ticket getting generated and defeats the whole purpose.

I was thinking, if I could modify the nagios binary to calculate and return a FATAL message, which still will be a return code 3 and nagios console shows it as UNKNOWN, but my perl script catches the message from the event and send a FATAL to Netcool and I get a Sev-1 ticket.

Thank you
Rakesh
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: New Error Code for Nagios Core

Post by hsmith »

If you're interested in modifying Nagios Core, the source code can be found here: https://github.com/NagiosEnterprises/nagioscore. There's not a lot we're going to be able to do on our end, but it sounds like you already have a lot of good ideas of how you would like to handle this.
Former Nagios Employee.
me.
crkmenon
Posts: 5
Joined: Fri Apr 24, 2015 1:49 am

Re: New Error Code for Nagios Core

Post by crkmenon »

Thank you hsmith for the invitation. I would definitely see how I can contribute by translating the ideas into actuals. I in-fact have gone through NagiosStats.c and figured out the section that sends one of these return codes. I would probably make changes, compile and run a test sometime the last week of this month and see how it behaves.

I will just need to know if just making the changes and adding it the file and run the make would compile all of the nagios core file and do a deployment for me or should I have some other steps to follow.

Thank you
Rakesh
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: New Error Code for Nagios Core

Post by hsmith »

Thanks for the followup. Please share any findings with us that you find interesting. I do have to point out that this kind of discussion is best saved for the GitHub page instead of the forums. The forums are more for support of the products we already offer. Developers are less likely to see your post here than they are on GitHub. Good luck with this project!
Former Nagios Employee.
me.
Locked