[SOMEWHAT SOLVED] Question about remote syslog logging during kickstart
Chun Tat David Chu
beyonddc.storage at gmail.com
Mon Jul 25 20:42:25 UTC 2011
In case anyone would like to know, Below is my current solution. Basically
I am using Anaconda Python logging facility.
Please let me know if anyone has any more alternative solutions.
Thanks,
David
#!/usr/bin/python
import syslog
import time
import sys
sys.path.append("/mnt/runtime/usr/lib/anaconda")
from anaconda_log import logger
import logging
def main():
log = logging.getLogger("anaconda")
logger.addSysLogHandler(log, <remote syslog server ip>)
counter = 0
while True:
counter = counter + 1
msg = "TESTING: %d" % counter
log.info(msg)
time.sleep(1)
# This module represents the scope in which the interpreter's
# main program executes
if __name__ == "__main__":
main()
On Mon, Jul 25, 2011 at 3:33 PM, Chun Tat David Chu <
beyonddc.storage at gmail.com> wrote:
> Hi All,
>
> This is related with remote syslog logging during kickstart in %pre and
> %post.
>
> Is there a way I can utilize what Anaconda is using to do remote syslog
> logging?
>
> I tried to write a Python script that invokes on the syslog.syslog()
> function but no luck. It is only logging to the local /tmp/syslog file. Is
> there a way I can get it to log to a remote syslog server?
>
> Thanks!!
>
> David
>
> On Mon, Jul 18, 2011 at 1:30 PM, Chun Tat David Chu <
> beyonddc.storage at gmail.com> wrote:
>
>> Hi All,
>>
>> I know that you can specify logging host by including 'logging --host
>> <hostname>' in the kickstart file so that Anaconda will log remotely.
>>
>> What I would like is to log custom messages during %pre and %post but I
>> couldn't figure out how to do so.
>>
>> It appears 'logger' is not available during %pre.
>>
>> My question is how to log remotely during %pre and %post.
>>
>> I am currently using RHEL 5.2.
>>
>> Thanks!
>>
>> - David
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20110725/0f6e6242/attachment.htm>
More information about the Kickstart-list
mailing list