This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
lijia-tsg-oam/py_src/tsg_software_reboot.py
2019-07-23 11:56:52 +08:00

25 lines
979 B
Python

import sys
import syslog
##define KERN_EMERG "<0>" /* system is unusable */
##define KERN_ALERT "<1>" /* action must be taken immediately */
##define KERN_CRIT "<2>" /* critical conditions */
##define KERN_ERR "<3>" /* error conditions */
##define KERN_WARNING "<4>" /* warning conditions */
##define KERN_NOTICE "<5>" /* normal but significant condition */
##define KERN_INFO "<6>" /* informational */
##define KERN_DEBUG "<7>" /* debug-level messages */
MSG_PREFIX = ['EMERG', 'ALERT', 'CRIT', 'ERR', 'WARNING', 'NOTICE', 'INFO', 'DEBUG']
def tsg_software_reboot():
log_handle = syslog.openlog("TSG-MXN")
msg = "[%s] %s" %(MSG_PREFIX[syslog.LOG_INFO], "software reboot success.")
syslog.syslog(syslog.LOG_INFO, msg)
print (msg)
return 0
if __name__ == '__main__':
fun_res_code = tsg_software_reboot()
sys.exit(fun_res_code)