<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Script attached:  Parsing $NOTICEPLAINTEXT and emailing it in Server Management - Systems Insight Manager</title>
    <link>https://community.hpe.com/t5/server-management-systems/script-attached-parsing-noticeplaintext-and-emailing-it/m-p/4146320#M61985</link>
    <description>&lt;!--!*#--&gt;How to Parse the $NOTICEPLAINTEXT variable from HP SIM and email it&lt;BR /&gt;&lt;BR /&gt;I struggled with this forever and finally broke down and wrote the perl script that does this.  Basically just create a new custom tool that calls: C:\Perl\bin\perl.exe C:\hp\sim_alerts\parse.pl &lt;BR /&gt;&lt;BR /&gt;Then set up your notifications to call the custom tool you just created.  Next was the hard part, parse.pl.  This file takes the $NOTICEPLAINTEXT env. variable from SIM Alerts and parses by pipe delimitation and put it in a friend format.  The email portion of this is done with a free email program call blat (Thanks Ron Buxton) that is super easy to set on your SIM server and has no security risk.&lt;BR /&gt;&lt;BR /&gt;Parse.pl&lt;BR /&gt;-------------------&lt;BR /&gt;#So you can use Environment variables&lt;BR /&gt;use Env;&lt;BR /&gt;&lt;BR /&gt;#assigns NOTICEPLAINTEXT to info&lt;BR /&gt;$info = $NOTICEPLAINTEXT;&lt;BR /&gt;&lt;BR /&gt;#Splits the NOTICEPLAINTEXT variable up by pipe delimitation and stores it in an array&lt;BR /&gt;@array = split('\|', $info);&lt;BR /&gt;&lt;BR /&gt;#opens the email body up&lt;BR /&gt;open MAILDIST, '&amp;lt;&amp;gt;open MAILTMP, '&amp;gt; mailmajor.tmp';&lt;BR /&gt;&lt;BR /&gt;#Prints the SIM event array in the message body (I've seen up to 15, so that's why I print 15 times)&lt;BR /&gt;  print MAILTMP @array[0];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[1];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[2];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[3];&lt;BR /&gt;  print MAILTMP "\n";  &lt;BR /&gt;  print MAILTMP @array[4];&lt;BR /&gt;  print MAILTMP "\n";  &lt;BR /&gt;  print MAILTMP @array[5];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[6];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[7];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[8];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[9];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[10];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[11];&lt;BR /&gt;  print MAILTMP "\n";  &lt;BR /&gt;  print MAILTMP @array[12];&lt;BR /&gt;  print MAILTMP "\n";  &lt;BR /&gt;  print MAILTMP @array[13];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[14];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[15];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;#Sets the email Subject to the Event Name: passed by $NOTICEPLAINTEXT&lt;BR /&gt;$Subject=@array[0];&lt;BR /&gt;&lt;BR /&gt;#closes the body of the email&lt;BR /&gt;close MAILTMP;&lt;BR /&gt;&lt;BR /&gt;#set who you are sending to&lt;BR /&gt;$MailUser='someone@someone.com';&lt;BR /&gt;&lt;BR /&gt;#sends the email&lt;BR /&gt;system "blat.exe mailmajor.tmp -to \"$MailUser\" -subject \"$Subject \" \n";&lt;BR /&gt;&lt;BR /&gt;#email cleanup&lt;BR /&gt;unlink 'mailmajor.tmp';&lt;BR /&gt;close MAILDIST;&lt;BR /&gt;--------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Please reply to this post if you have any issues.&lt;BR /&gt;This script has been attached to this post.</description>
    <pubDate>Sun, 17 Feb 2008 17:34:02 GMT</pubDate>
    <dc:creator>Shane Shelton</dc:creator>
    <dc:date>2008-02-17T17:34:02Z</dc:date>
    <item>
      <title>Script attached:  Parsing $NOTICEPLAINTEXT and emailing it</title>
      <link>https://community.hpe.com/t5/server-management-systems/script-attached-parsing-noticeplaintext-and-emailing-it/m-p/4146320#M61985</link>
      <description>&lt;!--!*#--&gt;How to Parse the $NOTICEPLAINTEXT variable from HP SIM and email it&lt;BR /&gt;&lt;BR /&gt;I struggled with this forever and finally broke down and wrote the perl script that does this.  Basically just create a new custom tool that calls: C:\Perl\bin\perl.exe C:\hp\sim_alerts\parse.pl &lt;BR /&gt;&lt;BR /&gt;Then set up your notifications to call the custom tool you just created.  Next was the hard part, parse.pl.  This file takes the $NOTICEPLAINTEXT env. variable from SIM Alerts and parses by pipe delimitation and put it in a friend format.  The email portion of this is done with a free email program call blat (Thanks Ron Buxton) that is super easy to set on your SIM server and has no security risk.&lt;BR /&gt;&lt;BR /&gt;Parse.pl&lt;BR /&gt;-------------------&lt;BR /&gt;#So you can use Environment variables&lt;BR /&gt;use Env;&lt;BR /&gt;&lt;BR /&gt;#assigns NOTICEPLAINTEXT to info&lt;BR /&gt;$info = $NOTICEPLAINTEXT;&lt;BR /&gt;&lt;BR /&gt;#Splits the NOTICEPLAINTEXT variable up by pipe delimitation and stores it in an array&lt;BR /&gt;@array = split('\|', $info);&lt;BR /&gt;&lt;BR /&gt;#opens the email body up&lt;BR /&gt;open MAILDIST, '&amp;lt;&amp;gt;open MAILTMP, '&amp;gt; mailmajor.tmp';&lt;BR /&gt;&lt;BR /&gt;#Prints the SIM event array in the message body (I've seen up to 15, so that's why I print 15 times)&lt;BR /&gt;  print MAILTMP @array[0];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[1];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[2];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[3];&lt;BR /&gt;  print MAILTMP "\n";  &lt;BR /&gt;  print MAILTMP @array[4];&lt;BR /&gt;  print MAILTMP "\n";  &lt;BR /&gt;  print MAILTMP @array[5];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[6];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[7];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[8];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[9];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[10];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[11];&lt;BR /&gt;  print MAILTMP "\n";  &lt;BR /&gt;  print MAILTMP @array[12];&lt;BR /&gt;  print MAILTMP "\n";  &lt;BR /&gt;  print MAILTMP @array[13];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[14];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  print MAILTMP @array[15];&lt;BR /&gt;  print MAILTMP "\n";&lt;BR /&gt;  &lt;BR /&gt;&lt;BR /&gt;#Sets the email Subject to the Event Name: passed by $NOTICEPLAINTEXT&lt;BR /&gt;$Subject=@array[0];&lt;BR /&gt;&lt;BR /&gt;#closes the body of the email&lt;BR /&gt;close MAILTMP;&lt;BR /&gt;&lt;BR /&gt;#set who you are sending to&lt;BR /&gt;$MailUser='someone@someone.com';&lt;BR /&gt;&lt;BR /&gt;#sends the email&lt;BR /&gt;system "blat.exe mailmajor.tmp -to \"$MailUser\" -subject \"$Subject \" \n";&lt;BR /&gt;&lt;BR /&gt;#email cleanup&lt;BR /&gt;unlink 'mailmajor.tmp';&lt;BR /&gt;close MAILDIST;&lt;BR /&gt;--------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Please reply to this post if you have any issues.&lt;BR /&gt;This script has been attached to this post.</description>
      <pubDate>Sun, 17 Feb 2008 17:34:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-systems/script-attached-parsing-noticeplaintext-and-emailing-it/m-p/4146320#M61985</guid>
      <dc:creator>Shane Shelton</dc:creator>
      <dc:date>2008-02-17T17:34:02Z</dc:date>
    </item>
  </channel>
</rss>

