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

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

try to write to syslog on 2960 15.0(2)SE10

Hello,

I trying to write to the syslog on a 2960 with 15.0(2)SE10.

I'm using this proc:

proc writelog {message {trace 0}} {
   if $trace then {puts stdout "write to syslog: $message"}
   set syslog [open "syslog:" w+]
   puts $syslog "aclupdate: $message"
   close $syslog
   }

but after 'set syslog [open "syslog:" w+] ' I get an errormessage : 'couldn't open "syslog:": No such device'

It works on a 2960X but not on the 2960.

Is there a way to get this running on a 2960 box?

Kind regards,

Andreas

  • EEM Scripting
1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

You can use the "send log"

You can use the "send log" command:

exec "send log facility TRACE severity 6 mnemonics LOG This is a test"

4 REPLIES
Cisco Employee

I thought syslog: was

I thought syslog: was generally available, but I guess it was not included in all images.  I know the 2960s did lack quite a bit in terms of embedded automation.  Unfortunately, I can't think of a good workaround in this case.  The version of code lacks UDP support, so you would not be able to send a syslog via a UDP socket.  If your syslog server supports syslog over TCP, then you could do that.

New Member

Hello Joe,

Hello Joe,

thank you for the reply.

I don't want to write to a syslog server. I want to write to the internal syslog, like the EEM can do with the "action_syslog" command, but I have no EEM on the 2960.

So, no chance at all? 

Kind regards,

Andreas

Cisco Employee

You can use the "send log"

You can use the "send log" command:

exec "send log facility TRACE severity 6 mnemonics LOG This is a test"

New Member

Thanks, "send log" works on

Thanks, "send log" works on that device. I'll update my script to change the method depending on the platform where it runs.

Kind regards!

15
Views
0
Helpful
4
Replies
This widget could not be displayed.