Hi all,
I have searched through iControl documentation however was unable to find an answer to my question:
How do I write stuff to the box’s syslog using iControl?
Is there a call anywhere like this: iControl.Syslog(“local0”,“My text to appear in syslog”)???
It does not seem like you there is a way to execute arbitrary commands on the bigIP via icontrol, if there was, then you would run the logger command to inject messages into syslog.
Outside of iControl, maybe you can use SSH to remotely execute the logger commands.
Mohamed.
That is correct, at this time there is no way to issue commands on the BIG-IP. We’ve abstracted system commands through the APIs for security reasons and have not yet had a request to support syslog messages directly through the API.
If you need to update the syslog remotely, then you could, as Mohamed suggested, remotely issue a command over SSH.
Another option could be to create a dummy iRule with the log message in the RULE_INIT event. By adding the iRule, the RULE_INIT will get triggered and then you can delete the iRule when you are finished. The LocalLB::Rule interface contains the methods and a simple rule like this
when RULE_INIT {
log local0. "LOG SOMETHING HERE"
}
would work.
Now, you probably wouldn’t want to do this every second as that would cause some overhead on the system, but if it’s a infrequent event, then this approach shouldn’t cause any issues.
-Joe
Joe, thanks for the iRule workaround to my problem.
I am surprised that nobody has asked F5 to support syslog messages directly through the iControl API.
iControl application developers need to log actions of their applications, so it makes sense to use the box’s built-in syslog service for many reasons including security, convenience of keeping everything in one place, usage of only one protocol(SOAP) to talk to the box, etc…