Implementing Notification Variables

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
mikew
Posts: 243
Joined: Sun Feb 05, 2012 7:05 pm

Implementing Notification Variables

Post by mikew »

I am have created 6 custom notification macros for hosts and services.

Code: Select all

_Department 	IT-Staff-Infrastructure
_Owner		IT-Staff-Infrastructure	
_ServiceRoles	Symantec Backup	
_ContactName	IT-Staff-SysAdmin	
_Location	Tech Building	
_City		Houston
I have added the information to one host as proof of concept and modified the xi_host_notification_handler and xi_service_notification_handler with this information.

Code: Select all

--department="$_HOSTDEPARTMENT$" --owner="$_HOSTOWNER$" --serviceroles="$_HOSTSERVICEROLES$" --contactname="$_HOSTCONTACTNAME$" --location="$_HOSTLOCATION$" --city="$_HOSTCITY$"
I have also modified the Notification Management to force this on all users to meet company standards.

Code: Select all

Department: %department%
Owner: %owner%
ServiceRoles: %serviceroles%
ContactName: %contactname%
Location: %location%
City: %city%
Everything works....except now I have to do this 3500 times. The information for each host is different.

My question is, is there a script that I can use to add this to config files or import it somehow...3500 times is going to be rough...
Mike Weber

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

Re: Implementing Notification Variables

Post by scottwilkerson »

Mike,

** TAKE A BACKUP FIRST **

If you take the host config files, modify them to include the free variables and then place them in the /usr/local/nagios/etc/import directory they will overwrite the existing file upon Apply Configuration

** TAKE A BACKUP FIRST **
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
mikew
Posts: 243
Joined: Sun Feb 05, 2012 7:05 pm

Re: Implementing Notification Variables

Post by mikew »

Ya, that was what I was thinking...makes me a touch nervous. I will set up a demo account create the script and then report back, in case others get stuck with this type of situation.
Mike Weber

Nagios Training/Consulting
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Implementing Notification Variables

Post by lmiltchev »

Sure, Mike. Let us know how it went.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked