HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Server Management - Systems Insight Manager
- >
- Script attached: Parsing $NOTICEPLAINTEXT and ema...
Server Management - Systems Insight Manager
1832910
Members
2806
Online
110048
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2008 09:34 AM
02-17-2008 09:34 AM
Script attached: Parsing $NOTICEPLAINTEXT and emailing it
How to Parse the $NOTICEPLAINTEXT variable from HP SIM and email it
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
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.
Parse.pl
-------------------
#So you can use Environment variables
use Env;
#assigns NOTICEPLAINTEXT to info
$info = $NOTICEPLAINTEXT;
#Splits the NOTICEPLAINTEXT variable up by pipe delimitation and stores it in an array
@array = split('\|', $info);
#opens the email body up
open MAILDIST, '<>open MAILTMP, '> mailmajor.tmp';
#Prints the SIM event array in the message body (I've seen up to 15, so that's why I print 15 times)
print MAILTMP @array[0];
print MAILTMP "\n";
print MAILTMP @array[1];
print MAILTMP "\n";
print MAILTMP @array[2];
print MAILTMP "\n";
print MAILTMP @array[3];
print MAILTMP "\n";
print MAILTMP @array[4];
print MAILTMP "\n";
print MAILTMP @array[5];
print MAILTMP "\n";
print MAILTMP @array[6];
print MAILTMP "\n";
print MAILTMP @array[7];
print MAILTMP "\n";
print MAILTMP @array[8];
print MAILTMP "\n";
print MAILTMP @array[9];
print MAILTMP "\n";
print MAILTMP @array[10];
print MAILTMP "\n";
print MAILTMP @array[11];
print MAILTMP "\n";
print MAILTMP @array[12];
print MAILTMP "\n";
print MAILTMP @array[13];
print MAILTMP "\n";
print MAILTMP @array[14];
print MAILTMP "\n";
print MAILTMP @array[15];
print MAILTMP "\n";
#Sets the email Subject to the Event Name: passed by $NOTICEPLAINTEXT
$Subject=@array[0];
#closes the body of the email
close MAILTMP;
#set who you are sending to
$MailUser='someone@someone.com';
#sends the email
system "blat.exe mailmajor.tmp -to \"$MailUser\" -subject \"$Subject \" \n";
#email cleanup
unlink 'mailmajor.tmp';
close MAILDIST;
--------------------------------------------------------
Please reply to this post if you have any issues.
This script has been attached to this post.
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
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.
Parse.pl
-------------------
#So you can use Environment variables
use Env;
#assigns NOTICEPLAINTEXT to info
$info = $NOTICEPLAINTEXT;
#Splits the NOTICEPLAINTEXT variable up by pipe delimitation and stores it in an array
@array = split('\|', $info);
#opens the email body up
open MAILDIST, '<>open MAILTMP, '> mailmajor.tmp';
#Prints the SIM event array in the message body (I've seen up to 15, so that's why I print 15 times)
print MAILTMP @array[0];
print MAILTMP "\n";
print MAILTMP @array[1];
print MAILTMP "\n";
print MAILTMP @array[2];
print MAILTMP "\n";
print MAILTMP @array[3];
print MAILTMP "\n";
print MAILTMP @array[4];
print MAILTMP "\n";
print MAILTMP @array[5];
print MAILTMP "\n";
print MAILTMP @array[6];
print MAILTMP "\n";
print MAILTMP @array[7];
print MAILTMP "\n";
print MAILTMP @array[8];
print MAILTMP "\n";
print MAILTMP @array[9];
print MAILTMP "\n";
print MAILTMP @array[10];
print MAILTMP "\n";
print MAILTMP @array[11];
print MAILTMP "\n";
print MAILTMP @array[12];
print MAILTMP "\n";
print MAILTMP @array[13];
print MAILTMP "\n";
print MAILTMP @array[14];
print MAILTMP "\n";
print MAILTMP @array[15];
print MAILTMP "\n";
#Sets the email Subject to the Event Name: passed by $NOTICEPLAINTEXT
$Subject=@array[0];
#closes the body of the email
close MAILTMP;
#set who you are sending to
$MailUser='someone@someone.com';
#sends the email
system "blat.exe mailmajor.tmp -to \"$MailUser\" -subject \"$Subject \" \n";
#email cleanup
unlink 'mailmajor.tmp';
close MAILDIST;
--------------------------------------------------------
Please reply to this post if you have any issues.
This script has been attached to this post.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP