- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Server Management (Insight Manager 7)
- >
- Re: hpasm and trapemail directive
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
05-23-2005 11:30 PM
05-23-2005 11:30 PM
hpasm and trapemail directive
In /opt/compaq/cma.conf there are these lines describing trapemail:
########################################################################
# trapemail is used for configuring email command(s) which will be
# executed whenever a SNMP trap is generated.
# Multiple trapemail lines are allowed.
# Note: any command that reads standard input can be used. For example:
# trapemail /usr/bin/logger
# will log trap messages into system log (/var/log/messages).
########################################################################
I have tried different trapemail commands, including the normal logger, but none of them are executed.
Anyone got "trapemail" working, i.e. piping messages to custom programs? This seems like a nice solution if it works, instead of watching logs...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2005 01:06 AM
05-24-2005 01:06 AM
Re: hpasm and trapemail directive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2005 01:38 AM
05-24-2005 01:38 AM
Re: hpasm and trapemail directive
What should trigger the trapemail command? Are there any configurable thresholds?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2005 02:48 AM
05-25-2005 02:48 AM
Re: hpasm and trapemail directive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2005 04:01 AM
08-08-2005 04:01 AM
Re: hpasm and trapemail directive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2005 05:25 AM
08-08-2005 05:25 AM
Re: hpasm and trapemail directive
In my cma.conf I have two "trapemail" commands:
trapemail /usr/bin/logger -t TRAPEMAIL
trapemail /usr/bin/hptrapmail
The first line sends the message to the logger. The second line sends the message to my own script (hptrapmail) which is as follows:
#!/usr/bin/perl
#
# Script which sends mail from HP Insight Manager snmp agents.
# list recipients here
@recipients = ("recipient1\@somehost.com",
"recipient2\@otherhost.com");
# sysadmin email (used in from and reply-to email headers)
$sysadmin = "sysadmin\@somehost.com";
# variables
$sendmail = "/usr/sbin/sendmail -t -oi"; # mail program
$server = `hostname`; # this computer name
$dt = `date`; # current date and time
chomp ($dt); # remove newline
open(MAIL, "|$sendmail") || die("Could not open pipe to sendmail: $!");
foreach $recipient (@recipients) {
print MAIL "To: " . $recipient . "\n";
}
print MAIL <
Reply-To: Sysadmin <$sysadmin>
Subject: Agent Trap Alarm on $server ($dt)
EOF
while (<>) {
print MAIL $_;
}
close MAIL || die("Could not close pipe to sendmail: $!");
/usr/sbin/sendmail in this case is not sendmail but a symlink to a wrapper(ssmtp):
lrwxrwxrwx 1 root root 15 Dec 6 2004 /usr/sbin/sendmail -> /usr/sbin/ssmtp
Good luck!