Re: [SOMEWHAT SOLVED] Question about remote syslog logging during kickstart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@xxxxxxxxx> 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


_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux