×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Command For Automatic Action (audible and email)

Command For Automatic Action (audible and email)

Command For Automatic Action (audible and email)

(OP)
I have an event that when received I want it to execute an audible and an email. Both work independently. I want to put both commands in the “Command for Automatic Action” field to execute both an audible and send an e-mail. Does anyone know what character I can use to separate the two commands?

RE: Command For Automatic Action (audible and email)

Try the pipe "|"

RE: Command For Automatic Action (audible and email)

(OP)
Thanks, The pipe doesn’t work. I have had to run the other command from Perl in the first script. I tried everything I could think of but never got it to work. If anyone does I would like to know.

RE: Command For Automatic Action (audible and email)

I have a windows platform and have many events that perform various functions regularly.  I have up to 3 commands on the command line for auto actions separated by the | and it works fine.  The commands execute a batch file, java script, and an ovevent command.

What command are you using?

RE: Command For Automatic Action (audible and email)

(OP)
Wow, My next post I will put in some of the commands I used. Did you use a space,pipe,space? Pipe in quotes, or \\?

RE: Command For Automatic Action (audible and email)

(OP)
goldiec74

c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Down" $5  | mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\NodeupPC.WAV

I looked back at my notes, I tried it with and without spaces, I think. Now I'm not so sure. Anyway the line above did not work. Can you suggest anything?

RE: Command For Automatic Action (audible and email)

(OP)
I have tried the following combinations in ovactions node down and node up looking for one that would work. To refresh, I am trying to launch two automatic actions from the automatic action field in the event configuration dialog box. Both commands work independently of each other.

**Test "|" pipe separator...

c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Down" $5 | mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodedowntest.WAV
c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Up" $5|mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodeuptest.WAV

neither above worked

mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodedowntest.WAV
mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodeuptest.WAV

above worked without em script.

c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Down" $5
c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Up" $5

above worked without audible


mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodedowntest.WAV | c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Down" $5
mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodeuptest.WAV|c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Up" $5

above resulted in a Mediplayer error "cannot determine the device type from the given filename extension.

"mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodedowntest.WAV" | c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Down" $5
"mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodeuptest.WAV"|c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Up" $5

above resulted, no audible. no em and got the below ovaction error in LOG.
Tue Feb 15 09:54:54 Command ""mplay32 -play -close C:\Program Files\HP OpenView\NNM\audiofiles\Nodedowntest.WAV" | c:\ovscripts\perl "C:\ovscripts\scripts\email_alert_nw.pl" 10.196.4.93 "Node Down" 1108479293" exited with value 1.
Tue Feb 15 09:55:17 Command ""mplay32 -play -close C:\Program Files\HP OpenView\NNM\audiofiles\Nodeuptest.WAV"|c:\ovscripts\perl "C:\ovscripts\scripts\email_alert_nw.pl" 10.196.4.93 "Node Up" 1108479310" exited with value 1.

'mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodedowntest.WAV' | c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Down" $5
'mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodeuptest.WAV'|c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Up" $5

above resulted, no audible. no em and got the below ovaction error in LOG.
Tue Feb 15 10:00:37 Command "'mplay32 -play -close C:\Program Files\HP OpenView\NNM\audiofiles\Nodedowntest.WAV' | c:\ovscripts\perl "C:\ovscripts\scripts\email_alert_nw.pl" 10.196.4.93 "Node Down" 1108479636" exited with value 1.
Tue Feb 15 10:00:53 Command "'mplay32 -play -close C:\Program Files\HP OpenView\NNM\audiofiles\Nodeuptest.WAV'|c:\ovscripts\perl "C:\ovscripts\scripts\email_alert_nw.pl" 10.196.4.93 "Node Up" 1108479647" exited with value 1.

mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\"Nodedowntest.WAV" | c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Down" $5
mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\"Nodeuptest.WAV"|c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Up" $5

"Nodedowntest.WAV" |
"Nodeuptest.WAV"|







**Test ";" semicolon separator...

c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Down" $5 ; mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodedowntest.WAV
c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Up" $5;mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodeuptest.WAV

above resulted, no audible, no em, no ovaction event in the LOG.

mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodedowntest.WAV ; c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Down" $5
mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\Nodeuptest.WAV;c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Up" $5

above resulted in a Mediplayer error "cannot determine the device type from the given filename extension.

mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\"Nodedowntest.WAV" ; c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Down" $5
mplay32 -play -close C:\\Program Files\\HP OpenView\\NNM\\audiofiles\\"Nodeuptest.WAV";c:\\ovscripts\\perl "C:\\ovscripts\\scripts\\email_alert_nw.pl" $2 "Node Up" $5

above resulted in a Mediplayer error "cannot determine the device type from the given filename extension.

RE: Command For Automatic Action (audible and email)

Here's an example of one of my automatic actions:

OVHIDESHELL LM_playSounds.bat | LM_PollOnEvent.bat $r | ovevent -s Critical -c "Error Alarms" "" .1.3.6.1.4.1.11.2.17.1.0.58916871 .1.3.6.1.4.1.11.2.17.2.1.0 Integer 14 .1.3.6.1.4.1.11.2.17.2.2.0 OctetString "$8_Resources" .1.3.6.1.4.1.11.2.17.2.4.0 OctetString "Status is" .1.3.6.1.4.1.11.2.17.2.4.0 OctetString "Critical"

The command is one continuous string.  I'm sure you know about OVHIDESHELL.  You'll probably want to take that off while you are testing.  the LM_playSounds.bat file contains the following (I've included only the command for playing sounds locally, if you need to play a sound on a remote windows box from a windows server let me know):

@echo off
"c:\program files\windows media player\mplayer2.exe" /play /close c:\winnt\media\utopia windows exit.wav


The next command, LM_PollOnEvent.bat $r, executes a batch file to poll the reporting node to determine if certain processes are running.

The last command (the really long one) sets a custom icon to critical based on this event.

Make sure any batch files you create are placed in the hpov\bin directory.  

Best of luck and let me know if you need further clarification and whether or not this helps!

RE: Command For Automatic Action (audible and email)

Hi Ru55ell, I see that you are using a perl script that sends emails on the automated feature of NNM called email_alert_nw.pl, can I please have it? I also want to receive emails on automated actions....

RE: Command For Automatic Action (audible and email)

(OP)
Read up on Nigel's Perl Script. You can find it and info in this forum. Here is a link to a thread that mentions the script.

http://www.tek-tips.com/viewthread.cfm?qid=711207

To update this thread I have discovered two ways to execute two actions when an event occurs. One way is to put a batch file in the OV actions that runs the audible and invokes the e-mail script. The other is to put the script in the OV actions and call both actions to be executed from the script. I don’t have a preference as they both perform flawlessly.

RE: Command For Automatic Action (audible and email)

Geesh,

I've done this heaps before.  Doesn't the pipe command

" | "

work?  I'll research but I'm pretty sure that worked for me.

Cheers,

Larry

RE: Command For Automatic Action (audible and email)

(OP)
Hey great Larry, Thanks in advance for any time you spend on this. I’d really like to be able to put two actions in the “OV Actions” field. This would help because I have different variations of automatic actions depending on the event. This way I could manage it easier. I have tried all the combinations previously posted without success.

RE: Command For Automatic Action (audible and email)

Try putting your commands in separate .bat file (make sure that you call ov.envvars.bat from the .bat file) and separate them with a " | ".  This works perfectly everytime.

RE: Command For Automatic Action (audible and email)

(OP)
goldiec74
    Thanks for your input thus far. What is “ov.envvars.bat” . Should I create a batch file for each action I want performed and then enter the batch files on the ovactions line separated by a <space><pipe><space>? I could see the value in this because I can use different combinations of batch files to get the results wanted depending on the event.

RE: Command For Automatic Action (audible and email)

ov.envvars.bat sets the HPOV environment variables.  You'll need this instead of hard coding the path in your script (e.g., %OV_CONF% instead of c:\program files\hp openview\nnm\conf).  Just enter a line that says:

call ov.envvars.bat

I have a bat file that executes sound and another one that calls a java program to change the icon from one type to another.  The event conditions are the same sometimes and different others so I may have an action that looks like this for one:

playsound | changeicon

or it might be just playsound.

Remember to put the bat files in the HPOV bin (%OV_BIN%) directory so that you can call directly from the automatic action.  We have the bat file in bin and a custom directory in bin containing the java program that is called from the bat file.

RE: Command For Automatic Action (audible and email)

(OP)
Recent Status.

I got a script to works and pretty well at that. The only issue I have with it is it is slow. I’ll explain.

I have several classifications of nodes. Each classification when a down event arrives sets off a unique audible and e-mails a group of technicians. I have one script that contains all the coditions and e-mail list. (One script makes for easy maintenance.) The script is slow in that it processes one event at a time and when hammered with multiple events takes a while to process all of them. This results in delayed audibles. Ideally it would process the audio separate from the e-mails and result in the audibles being heard in a chain (or closer cadence) when multiple devices go down.

I will keep this page updated as progress is made.

P.S. Moonsdarkside, post you scripts if possible.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close