cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1033
Views
5
Helpful
6
Replies

CiscoWorks:LMS3.2:RME4.3:Tools:Syslog:Automated Scripts fail .bat

roger
Level 1
Level 1

How do I troubleshoot what appears to be a failure to call a script (CSCOpx/files/scripts/syslog/a.bat)?

Events trigger and send emails successfully, script for a.bat file fail

I have setup an automated action based upon Syslog Events.

CiscoWorks:LMS3.2:RME4.3:Tools:Syslog:Automated Scripts fail .bat

6 Replies 6

Michel Hegeraat
Level 7
Level 7

Check these files for errors matching your automated action  name/ip address/syslog message

AnalyzerDebug.log,

rme_base.log,

SyslogAnalyzer.log (Windows),

daemons.log (Solaris)

Raise the debug level on SyslogAnalyzer process if you dont find anything.

Can you run the batch file manualy?

The batch file is run as user "casuser".

Check if that user can run the batch

Cheers,

Michel

Only logging reference found was in AnalyzerDebug.log

In the log I find a ref:

[ Thu Dec 16  11:42:40 MST 2010 ],INFO ,[Thread-1],STDOUT: The system cannot find the file specified.
         args: syslog20101216, 433-201-cir1234, , 433-201-CIR1234

I then put full paths into the .bat file and see no further entries.

I can run the .bat file inside the CSCOpx/files/scripts/syslog directory.

I'm still looking for the solution, thank you for your help.

First thing I would do is to change the batchfile in such way that it produces a log everytime it is run.

If it makes the logfile it gets called, if not it doesn't get called or the call fails. Hope you can generate the syslog message at will.

Most likely if it works fine if you call it by hand is that casuser can't for some reason.

I've had a similar problem but I didn't have the time to dig deeper. It was an issue where casuser couldn't run the cmd.exe in the windows directory.

I got it working by copying the cmd.exe to CSCOpx\bin directory where casuser has all rights.

I can't get my head arround windows security. It rarely does what I want/expect

Cheers,

Michel

Typos were removed  by: Michel Hegeraat 

I with you on that Window's security, so I put a shortcut to cmd.exe in CSCOpx/bin.

I'd prefer a link approach IF I can get windows to cooperate (I'll put that actual exe in if it doesn't work in next hour.)

I verified that the .bat is executable by casusers.

My ultimate hope is to use the .bat to grab the Args and immediately send into a Perl Script (for obvious reasons).

I have a copy command in the .bat to generate a key as to the file being run from CiscoWorks.

Here's the contents of CallOut2Perl.bat:

##

@ECHO OFF
REM Track
copy testbat.txt "syslogTestbat"  <<<< I'll check to see if it gets populated to verify activity

REM ECHO The value of Arg1 is "%1%"
REM ECHO The value of Arg2 is "%2%"
REM ECHO The value of Arg3 is "%3%"
REM ECHO The value of Arg4 is "%4%"

"d:\CSCOpx\bin\perl.exe"  D:\CSCOpx\files\scripts\syslog\perlPrint.pl syslogTest %1% %2% %3% %4%

##

Hopefully I'm not doing something stupid in 'DOS'.bat.  I really miss my Solaris Box....

I'll update you.. Thanks,

Better copy the cmd.exe file rather then a shortcut, and set casuser to all permisions on it.

Start the batch something like this:

@echo off

echo %date% %time%         >> yourlogfile.log

echo para1=%1 para2=%2   >> yourlogfile.log

Cheers,

Michel

Michel's point is a good one.  Typically, the problem seen on Windows with automated actions is wrong permissions on cmd.exe.  The casuser user (or casusers group) must have Read & Execute permissions on cmd.exe.  This will not be there by default.  You also don't need some many arguments in your script.  If you use %~1 and %~2 (the '~' is important), then that should work.

If you still have problems, go to RME > Admin > System Preferences > Application Loglevel Settings, and enable debugging for SyslogAnalyzer.  Reproduce the problem, then check the AnalyzerDebug.log for possible failure causes.