- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script to email ping output
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
Discussions
Discussions
Forums
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
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
тАО06-10-2002 09:10 AM
тАО06-10-2002 09:10 AM
My scripting is less to be desired for. Just bear with me. I have a script /opt/OV/bin/scripts/alarm with just the line see below (doesn't even count as a script it just contains one line) to mail me when a router goes down.
mailx -s "Router Down"
The script is called alarm in /opt/OV/bin/scripts/alarm
I have the following line for the automatic action on Openview Node manager
echo $A Router down at Sx on SX | /opt/OV/bin/scripts/alarm
$A = node name
$x = time
$X = date
The above are pre-defined variables within NNM
in the /opt/OV/bin/scripts/alarm executable I have just the line to mail a user.
mailx -s "Router Down" seun.ewulomi@arup.com
When a router goes down I get a mail as shown below in my microsoft exchange email
Boston Router down at 17:05:08 on 06/10/02
I will like to be able to add ping output(below) emailed as well within the email sent. I will be using the ping command as per below
ping -s
How can I extend the script to contain the ping output show by the command above
Please Any suggestions will be greatly appreciated.
regards,
gab
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-10-2002 09:11 AM
тАО06-10-2002 09:11 AM
Re: script to email ping output
My apologies. I am running Solaris 2.6 with Hp openview Network Node manager
regards,
gab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-10-2002 09:52 AM
тАО06-10-2002 09:52 AM
Re: script to email ping output
Create a named pipe:
mknod /tmp/probpipe p
ping vpart2 100 10 >/tmp/probpipe &
echo HELLO WORLD>/tmp/probpipe &
dd if=/tmp/probpipe | /opt/OV/bin/scripts/alarm
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2002 02:15 AM
тАО06-11-2002 02:15 AM
Re: script to email ping output
Dont seem to have got this working.
the command ping vpart2 100 10 >/tmp/probpipe &
what is vpart2. Do you mean the parameters e.g -s
I presume I will put
dd if=/tmp/probpipe | /opt/OV/bin/scripts/alarm - in the automatic action within NNM
Sorry for being naive but I have to ask these questions.
regards,
gab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2002 03:23 AM
тАО06-11-2002 03:23 AM
SolutionSorry, I left my system name on the "ping" line, try this:
Put the "ping", the "echo", AND the "dd" in the same spot:
ping -s
echo $A Router down at $x on $X > /tmp/probpipe &
dd if=/tmp/probpipe | /opt/OV/bin/scripts/alarm
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2002 07:58 AM
тАО06-11-2002 07:58 AM
Re: script to email ping output
It worked like a charm. I have even extended it to send me a traceroute output aswell.
Feel free to visit us on the otherside of the HP forum world with any queries relating to OpenView Network Node Manager.
Thank you very much.
regards,
gab