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
Solved! Go to Solution.
You can use the "send log" command:
exec "send log facility TRACE severity 6 mnemonics LOG This is a test"
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.
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
You can use the "send log" command:
exec "send log facility TRACE severity 6 mnemonics LOG This is a test"
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!