Page 1 of 1

Implementing Notification Variables

Posted: Sun Dec 22, 2013 7:23 pm
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...

Re: Implementing Notification Variables

Posted: Mon Dec 23, 2013 9:21 am
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 **

Re: Implementing Notification Variables

Posted: Mon Dec 23, 2013 9:40 am
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.

Re: Implementing Notification Variables

Posted: Mon Dec 23, 2013 11:32 am
by lmiltchev
Sure, Mike. Let us know how it went.