Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

RME - syslog automated actions

With LMS 2.2 we used to use the automated actions to send a 'netsend' to specific workstations to monitor some syslog messages, as well as the email notification.

Is there a way to do this in LMS 2.5.1 ?

I am assuming it would be with a script if possible, and if so an example would be greatly appreciated.

Thanks in advance

2 ACCEPTED SOLUTIONS

Accepted Solutions
Silver

Re: RME - syslog automated actions

You can also run a batchfile from the automated actions. If you create a batchfile in \CSCOpx\files\scripts\syslog\ you can call it from the automated actions.

There are examples in the helpfile and here is mine.

CD D:\CSCOpx\files\scripts\syslog\blat echo Syslog message generated by device : %* > body.txt

d:\CSCOpx\bin\blat.exe body.txt -t mail1@somewhere.com,mail2@somewhere.com -s "Config of %1 may have changed." -q

This sends a mail but with the device name in the subject unlike the standard mail.

netsend can be called from the batch with the %1 or %* parameters

(this worked just fine on a 2000 server, on a 2003 server I had to copy the cmd.exe in CSCOpx\bin to make it work.)

Cheers,

Michel

Cisco Employee

Re: RME - syslog automated actions

You should be able to adapt my sample AA script for that. Since I don't know exactly what you were doing before, I could not create a "net send" example.

The important things to know are that %~1 is the name of the device that sent the message and %~2 is the message itself.

5 REPLIES
Cisco Employee

Re: RME - syslog automated actions

Email is trivial to do in LMS 2.5.1. There is a specific typoe of automated action to perform this. As for script-based automated actions, these must either end in .bat (Windows) or .sh (Solaris). They must be placed in either /var/adm/CSCOpx/files/scripts/syslog (Solaris) or NMSROOT\files\scripts\syslog (Windows).

An example Windows automated action script would be:

@ECHO OFF

echo "Syslog Message from %~1" > C:\TEMP\%~1.txt

echo "Message body: %~2" >> C:\TEMP\%~1.txt

Where %1 is the name of the device and %2 is the syslog message itself. The "%~" is special notation for Windows that means expand the variable removing any embedded quotes. The result of this script would be to create a file under C:\TEMP named after the device with the syslog information in it.

More help is available in the RME online context sensititve help.

Community Member

Re: RME - syslog automated actions

Thanks for the reply, the email side is all working OK.

What I am trying to do is re-create the funtionality where I did a 'net send' of the syslog message to several hosts.

Thanks

Silver

Re: RME - syslog automated actions

You can also run a batchfile from the automated actions. If you create a batchfile in \CSCOpx\files\scripts\syslog\ you can call it from the automated actions.

There are examples in the helpfile and here is mine.

CD D:\CSCOpx\files\scripts\syslog\blat echo Syslog message generated by device : %* > body.txt

d:\CSCOpx\bin\blat.exe body.txt -t mail1@somewhere.com,mail2@somewhere.com -s "Config of %1 may have changed." -q

This sends a mail but with the device name in the subject unlike the standard mail.

netsend can be called from the batch with the %1 or %* parameters

(this worked just fine on a 2000 server, on a 2003 server I had to copy the cmd.exe in CSCOpx\bin to make it work.)

Cheers,

Michel

Cisco Employee

Re: RME - syslog automated actions

You should be able to adapt my sample AA script for that. Since I don't know exactly what you were doing before, I could not create a "net send" example.

The important things to know are that %~1 is the name of the device that sent the message and %~2 is the message itself.

Community Member

Re: RME - syslog automated actions

Thanks, that has solved it.

Just used - net send 'hostname' %* - for each user (comma separated)

138
Views
12
Helpful
5
Replies
CreatePlease to create content