Using "notification skins" is described in our documentation, but a less documented feature of our notification script is that it will also allow you to set skins for certain contacts. The way this works is by simply creating a directory with the contact name under the skin folder in question. Here's an example:
/opt/monitor/op5/notify/skins.mail/
This folder will contain your global, default e-mail skins used for outgoing notifications. You'll see files like "host.PROBLEM", "service.RECOVERY" and so on, corresponding to the object type and the notification type in question.
There's also this folder:
/opt/monitor/op5/notify/custom-skins/
If this folder exists, these are "custom" skins that will override the defaults globally. This is where you would place branded notifications, for example, or other custom skins that you may prefer.
Both folders are for global skins, but the notification script will also look in the following places (perl-code):
my @possible_dirs = (
# this is undocumented, but the code always used it if $custom_skin_dir existed
"$custom_skin_dir/skins.$method/$contact_name",
"$skin_dir/skins.$method/$contact_name",
"$custom_skin_dir/skins.$method",
"$skin_dir/skins.$method"
);
Meaning that if this folder exists:
/opt/monitor/op5/notify/skins.mail/yourname
Any outgoing mail notifications will primarily use files like "host.PROBLEM" or "service.RECOVERY" in this folder when sending outgoing e-mail notifications to the contact "yourname".
The same functionality, as visible from the code above, also works for the custom-skins folder.
Avoid spaces
Please note that contact names with spaces have not been tested, so try to avoid them if possible.
Examples
A custom skin directory was created for emails for user rcanillas. The line "THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION" was added to the end of the notification skins for the user. This can be verified when running a grep -rni
for the string against the directory:
# pwd
/opt/monitor/op5/notify/skins.mail/rcanillas
# grep -rni "CONTACT-SPECIFIC" .
./debug:68:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./host.ACKNOWLEDGEMENT:26:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./host.default:26:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./host.DOWNTIMECANCELLED:29:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./host.DOWNTIMEEND:30:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./host.DOWNTIMESTART:30:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./host.FLAPPINGDISABLED:26:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./host.FLAPPINGSTART:26:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./host.FLAPPINGSTOP:26:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./host.PROBLEM:26:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./host.RECOVERY:26:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./service.ACKNOWLEDGEMENT:33:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./service.default:33:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./service.DOWNTIMECANCELLED:37:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./service.DOWNTIMEEND:38:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./service.DOWNTIMESTART:38:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./service.FLAPPINGDISABLED:34:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./service.FLAPPINGSTART:34:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./service.FLAPPINGSTOP:34:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./service.PROBLEM:34:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
./service.RECOVERY:34:THIS IS A TEST CHANGE FOR A CONTACT-SPECIFIC MAIL NOTIFICATION
The resulting email notification will look like this, for a service and host notification, respectively:
Comments
0 comments
Please sign in to leave a comment.