Parent sending status to child, child serice objects

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
simon.pytches
Posts: 13
Joined: Mon Feb 13, 2012 9:38 am

Parent sending status to child, child serice objects

Post by simon.pytches »

Ok here's what i'm tying to do.

We have some HP EVA's I would like to monitor the. A number of eva's are managed by one server (an appliance).

Under nagios we have a number of host objects. the Appliance (host) as the parent and an eva (host) as a child with services running as children of the eva (host)

I would like to get the eva's to send traps to nagios, The problem i have is that as the eva's are managed by the appliance the IP address of the trap is login against the server object. How can I push the messages from the appliance out to each eva that's hosted under it. a typical trap message looks like this.

Tue Oct 23 17:22:07 2012 .1.3.6.1.4.1.232.0.136013021 INFORMATIONAL "Status Events" Appliance1 - Management Agent Event: Host APPLIANCE1 : SCellName-TimeDate eva01: 23-Oct-2012/17:22:07 : EventCode 13021 : Description Remote Service Test Event

In this message "Appliance1" is the hosting server and "eva01" is the eva. I was considering writing a service script for the eva (host) to read the snmptt.log file but this seems a slow way to capture the results, as they would have to come though on a sample based interval. The notifications would arrive quicker, if I could write an eventhandler to do the work, after the event on the appliance service. However, I would need to send the status of the handler to a different host service under the eva. How would I reference the eva service object in the server handler script, so i can post the message back to the passive eva service?

I the example above i would want to pass the following...

eva01, 23-Oct-2012/17:22:07, INFORMATIONAL, EventCode 13021, Desctiption Remote Service Test Event.

The reason I've split the EVA's out as separate hosts to the appliance is it means i can report by eva by eva serice.

Has anyone got any ideas how i can do this.

Cheers

Simon
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Parent sending status to child, child serice objects

Post by scottwilkerson »

You could add the script you develop to the /etc/snmp/snmptt.conf file.

If you look at this file you will see hunks of code that look like this

Code: Select all

EVENT nsNotifyShutdown .1.3.6.1.4.1.8072.4.0.2 "Status Events" Normal
FORMAT An indication that the agent is in the process of being shut down. $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "An indication that the agent is in the process of being shut down. $*"
SDESC
An indication that the agent is in the process of being shut down.
Variables:
EDESC
The EXEC line is where you will put your script. You can see what is currently processing the data by looking at /usr/local/bin/snmptraphandling.py and building your own handler
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
simon.pytches
Posts: 13
Joined: Mon Feb 13, 2012 9:38 am

Re: Parent sending status to child, child serice objects

Post by simon.pytches »

I've noticed that the snmptraphandling.py writes to the nagios.cmd file. Is it safe to write a bash script to do this as well could i use it as a method of updating other services or to reset host/service conditions.

Cheers

Simon
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Parent sending status to child, child serice objects

Post by scottwilkerson »

Yes, it just must use the correct format

http://old.nagios.org/developerinfo/ext ... ndlist.php
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked