{"id":265,"date":"2008-03-16T19:51:31","date_gmt":"2008-03-16T17:51:31","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=265"},"modified":"2008-03-16T19:53:39","modified_gmt":"2008-03-16T17:53:39","slug":"script-notification-logfile","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=265","title":{"rendered":"Script: Notification Logfile"},"content":{"rendered":"<p>I have seen a number of questions regarding notification log on the root management server (RMS). Unfortunately\u00c2\u00a0this is not a standard function, instead you have to\u00c2\u00a0look in the logfile of the mailserver, if it is SMTP notification. But there is a lot of operations manager administrators who don\u00c2\u00b4t have access to the mailserver or the SMTP logfiles.\u00c2\u00a0I have written a script to show you a solution to this, a script that will create a local notification logfile on the RMS.<\/p>\n<p>\u00c2\u00a0<\/p>\n<div style=\"text-align: center\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/www.contoso.se\/files\/notification.jpg\" \/><\/div>\n<p>\u00c2\u00a0<\/p>\n<p>Recipient &#8211; Configure your recipients with a notification device that use this channel. When you setup the notification channel, you input a name, use this as channel for the notification device. Input the recipient e-mail address as delivery address for the selected channel.<\/p>\n<p>Notifiation Channel &#8211; Setup a new command notification channel. This is the settings I use in my lab<\/p>\n<p>Notification command channel name: VBLogFile<br \/>\nFull path to file: c:\\windows\\system32\\cmd.exe<br \/>\nCommand line parameters: \/c C:\\send_mail.vbs &#8220;$Data\/Context\/DataItem\/AlertName$&#8221; &#8220;$Data\/Context\/DataItem\/ManagedEntityPath$\\$Data\/Context\/DataItem<br \/>\n\/ManagedEntityDisplayName$&#8221; &#8220;$Data\/Context\/DataItem\/AlertDescription$&#8221; &#8220;$Data\/Context\/DataItem\/LastModifiedBy$&#8221; &#8220;$Data\/Context\/DataItem\/Severity$&#8221; &#8220;$Data\/Context\/DataItem\/Priority$&#8221; &#8220;$Data\/Context\/DataItem\/ResolutionStateName$&#8221; &#8220;$Data\/Recipients\/To\/Address\/Address$&#8221;<br \/>\nIntial directory: C:\\<\/p>\n<p>Note that all Ops Mgr parameters are between &#8221; &#8220;, else the script will not work if the parameter includes a blank space. With my example settings the script has to be C:\\send_mail.vbs and the logfile will be created in the same directory.<\/p>\n<p>The script , send_mail.vbs, will get a number of parameters from the command notification channel. It will then translate severity and priority into words and send the mail. After that it output some data variables to the logfile, psmgr_notification_logfile.txt.<\/p>\n<p>You should change strFROM and strSMTP. strFROM is the sender e-mail address and strSMTP is the FQDN of your mailserver.<\/p>\n<p>You can download the script <a href=\"http:\/\/www.contoso.se\/files\/send_mail.rar\">here<\/a>.<\/p>\n<p>If you want to add more parameters, there are a lot of them at Kevin Holman&#8217;s webpage, <a href=\"http:\/\/blogs.technet.com\/kevinholman\/archive\/2007\/12\/12\/adding-custom-information-to-alert-descriptions-and-notifications.aspx\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have seen a number of questions regarding notification log on the root management server (RMS). Unfortunately\u00c2\u00a0this is not a standard function, instead you have to\u00c2\u00a0look in the logfile of the mailserver, if it is SMTP notification. But there is a lot of operations manager administrators who don\u00c2\u00b4t have access to the mailserver or the &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=265\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[19],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/265"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=265"}],"version-history":[{"count":0,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/265\/revisions"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=265"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}