cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2646
Views
15
Helpful
25
Replies

Syslog forward

HafezHaim
Level 1
Level 1

Has anyone know how to forward syslog messages to another syslog catcher from CiscoWorks LMS2.5 installed on solaris?

25 Replies 25

What are the contents of outbox.bat? To run this script properly, you need to do:

perl.exe outbox.pl ""

Where is a syslog message.

Sorry, I think I misread your email. I read the perl.exe ... line as you running the script manually. This is actually the contents of your batch script. But as I pointed out, you need to specify the argument. That is:

@ECHO OFF

D:\progra~1\cscopx\bin\perl.exe d:\progra~1\CSCOpx\files\scripts\syslog\outofbox.pl "%~2"

how can I enable syslog analyzer debugger?

To enable debugs for Syslog Analyzer you go to RME -> Admin -> System Preferences -> loglevel settings.

In the Application drop down menu, please select SyslogAnalyzer.

For Syslog Analyzer set the log Level to debug and for Syslog Analyzer User Interface set the log level to debug

Click apply

I have created the following script

#!/opt/CSCOpx/bin/perl

use strict;

use Sys::Syslog qw(:DEFAULT setlogsock);

my $msg = $ARGV[0];

setlogsock('udp');

$Sys::Syslog::host = '172.16.10.105';

syslog(LOG_INFO|LOG_LOCAL7, $msg);

closelog;

That an automated action runs it

d:\progra~1\CSCOpx\bin\perl.exe d:\progra~1

\CSCOpx\files\scripts\syslog\outofbox.pl

and i getting the following erros

D:\PROGRA~1\CSCOpx\files\scripts\syslog>outbox.bat

D:\PROGRA~1\CSCOpx\files\scripts\syslog>d:\progra~1\CSCOpx\bin\perl.exe d:\progr

a~1\CSCOpx\files\scripts\syslog\outofbox.pl

Bareword "LOG_INFO" not allowed while "strict subs" in use at d:\progra~1\CSCOpx

\files\scripts\syslog\outofbox.pl line 9.

Bareword "LOG_LOCAL7" not allowed while "strict subs" in use at d:\progra~1\CSCO

px\files\scripts\syslog\outofbox.pl line 9.

Execution of d:\progra~1\CSCOpx\files\scripts\syslog\outofbox.pl aborted due to

compilation errors.

Any help is appreciated

TIA

Mario

you missed the single quotes around

LOG_INFO|LOG_LOCAL7

so it should be

syslog('LOG_INFO|LOG_LOCAL7', $msg);

instead of

syslog(LOG_INFO|LOG_LOCAL7, $msg);

Thank you, now i get the following

D:\PROGRA~1\CSCOpx\files\scripts\syslog>outbox.bat

D:\PROGRA~1\CSCOpx\files\scripts\syslog>d:\progra~1\CSCOpx\bin\perl.exe d:\progr

a~1\CSCOpx\files\scripts\syslog\outofbox.pl

Invalid argument passed to setlogsock; must be 'unix' or 'inet' at d:\progra~1\C

SCOpx\files\scripts\syslog\outofbox.pl line 7

D:\PROGRA~1\CSCOpx\files\scripts\syslog>

TIA

OK, did not read carefully..

you cannot port you script to windows and use SYS::Syslog as this perl module is an interface to the UNIX syslogd.

Concerning syslog (and others), LMS on windows is not the same as on UNIX. Currently I have no possibility to give you an alternative, sorry..

OK, did not read carefully..

you cannot port you script to windows and use SYS::Syslog as this perl module is an interface to the UNIX syslogd.

Concerning syslog (and others), LMS on windows is not the same as on UNIX. Currently I have no possibility to give you an alternative, sorry..

OK, did not read carefully..

you cannot port you script to windows and use SYS::Syslog as this perl module is an interface to the UNIX syslogd.

Concerning syslog (and others), LMS on windows is not the same as on UNIX. Currently I have no possibility to give you an alternative, sorry..

You need to use the script from my later post:

#!/opt/CSCOpx/bin/perl

use strict;

use Sys::Syslog qw(:DEFAULT setlogsock);

my $msg = $ARGV[0];

setlogsock('inet');

$Sys::Syslog::host = '10.1.1.1';

syslog('info|local7', $msg);

closelog;

The first post required a newer version of Perl. This script will work both on Windows and Solaris.