Page 1 of 1
How to send general alarm to a Hypervisor?
Posted: Wed Feb 08, 2017 10:19 am
by Killride
Hello,
I'm a new user of nagios and I don't know how to send global alarm to a Hypervisor.
For exemple, I have 10 switchs supervised by Nagios. On Nagios, I have the detailled alarms and states. Each switchs is in a hostgroup (switch group)
Now, I would like to send a unique alarm of the global state of switchs to a hypervisor (Not nagios) like "Critical state on the network" regardless of the alarm or switch.
If I have a power supply alarm or a cpu alarm, I would like a unique critical alarm on the hypervisor.
I tried using the event handler on each with a bash script but I don't know if it's the better way and If it's possible.
Maybe can I monitor Nagios hostgroup via snmp request?
Thank you for your help
Re: How to send general alarm to a Hypervisor?
Posted: Wed Feb 08, 2017 11:02 am
by rkennedy
Now, I would like to send a unique alarm of the global state of switchs to a hypervisor (Not nagios) like "Critical state on the network" regardless of the alarm or switch.
Are you trying to get this alarm triggered when something changes states? If so, event handlers is probably the way to go. From the sounds of how you brought it up though, I took it as you want to be able to trigger this with a button.
As you're using Nagios XI - I would look at the 'Help' menu, which will outline how to use the API to poll for information. From here, you could create a simple bash script to curl the various hosts / services information you're after, and have it parse the JSON accordingly.
Another option is as you mentioned, use hostgroups / servicegroups to organize. One thing you could do from here, is scheduled a report to be sent of the 'Service Status Page' for a hostgroup / servicegroup, which would allow you to see all of the information in one place.
Re: How to send general alarm to a Hypervisor?
Posted: Thu Feb 09, 2017 3:54 am
by Killride
Thank you for your reply rkennedy,
I'm trying to make scheduled reports but it's a PDF or CSV, I will prepare to send a report at each hostgroup state change as an snmptrap to my hypervisor
Re: How to send general alarm to a Hypervisor?
Posted: Thu Feb 09, 2017 4:23 am
by Killride
Another thing I'm thinking about it's from my hypervisor I send snmp request to nagios to catch the informations in the Hostgroup Summary.
Cause in the Hostgroup summary, I have a tab with all I need. (see attachment)
Is It possible to have this informations by snmp request ? I didn't find the MIB for nagiosxi server.
Re: How to send general alarm to a Hypervisor?
Posted: Thu Feb 09, 2017 1:23 pm
by rkennedy
Killride wrote:Thank you for your reply rkennedy,
I'm trying to make scheduled reports but it's a PDF or CSV, I will prepare to send a report at each hostgroup state change as an snmptrap to my hypervisor
Hostgroups do not change states so I'm a bit confused here. The scheduled reports are intended to run at an interval, and not a trigger.
Killride wrote:Another thing I'm thinking about it's from my hypervisor I send snmp request to nagios to catch the informations in the Hostgroup Summary.
Cause in the Hostgroup summary, I have a tab with all I need. (see attachment)
Is It possible to have this informations by snmp request ? I didn't find the MIB for nagiosxi server.
Which information are you after through a trap - the number of OK/WARN/CRIT variables under hosts / services for x host group? Just want to make sure I'm understanding properly, and we're on the same page.
Re: How to send general alarm to a Hypervisor?
Posted: Mon Feb 13, 2017 7:14 am
by Killride
My bad, I would like to send a snmp request from my hypervisor to nagios to return the number of OK/WARN/CRIT variables under hosts / services for each hostgroups. I don't know if it's possible to do that.
Re: How to send general alarm to a Hypervisor?
Posted: Mon Feb 13, 2017 5:05 pm
by mcapra
Killride wrote:I would like to send a snmp request from my hypervisor to nagios to return the number of OK/WARN/CRIT variables under hosts / services for each hostgroups.
Our back-end API could be used to accomplish that task, though I doubt it would integrate easily with your existing hypervisor's management portal. Our API will return JSON and could handle complex queries like "state = critical AND hostgroup = my-host-group". You can review the API documentation in the "Help" section of the Nagios XI GUI.
EDIT: On the topic of SNMP specifically, you might also reference these talks held at past Nagios conferences:
https://support.nagios.com/kb/article.php?id=451
https://library.nagios.com/library/conf ... rt-bolton/
Re: How to send general alarm to a Hypervisor?
Posted: Tue Feb 14, 2017 6:49 am
by Killride
Thank you mcapra,
I checked the API Documentation and this is what I need. The only thing is that return a XML files so I have to create a script who parse the xml file and send a snmp trap to the hypervisor cause my hypervisor only works with snmp.
Do you have anothers suggestions about that?
Re: How to send general alarm to a Hypervisor?
Posted: Tue Feb 14, 2017 12:29 pm
by rkennedy
That sounds correct - parsing the XML will allow you to gain the metrics you're after for the payload.
Re: How to send general alarm to a Hypervisor?
Posted: Wed Mar 01, 2017 2:28 pm
by tmcdonald
Just checking in since we have not heard from you in a while. Did
@rkennedy's post clear things up or has the issue otherwise been resolved?