Hazard's stuff

29 Jun, 2023

Huawei OPS syslog example

— Posted by hazard @ 2023-06-29 10:54
Documentation from the Huawei site gives non-working examples and wrong names of parameters for OPS syslog logging. Below are syslog calls that actually work:
import ops

def ops_condition(_ops):
    status, err_log = _ops.syslog("Hello world", ops.INFORMATIONAL, ops.SYSLOG)
    status, err_log = _ops.syslog("Example critical error", ops.CRITICAL, ops.SYSLOG)