linerco.blogg.se

Python process monitor
Python process monitor







python process monitor

If(oneline = 'd'): # Check the interface status. If a match is found, the flag is set to 1 # Check the interface list, and add or delete interfaces as required. Result1, n11, n21 = (handle,"display interface brief")Įth_status = 1 # Command execution is abnormal, and the Ethernet interface status is set to error. You can modify the conditions as required. # The power status is set to abnormal in case of any power exception. Power2 = 0 # Set the backup power supply status to normal. If(oneline.find("PWR2") >= 0): # PWR2 indicates the backup power supply. Power1 = 0 # Set the master power supply status to normal. If(oneline.find("PowerOn") >= 0): # If poweron is displayed, it indicates that the current status is normal.

python process monitor

If(oneline.find("PWR1") >= 0): # PWR1 indicates the master power supply.

python process monitor

If (oneline.find("PWR") >= 0): # If PWR is displayed, it indicates the power information. Power2 = 1 # Set the backup power supply status to error.įor oneline in line: # Read the command output line by line. Power1 = 1 # Set the master power supply status to error. Power_status = 1 # Command execution is abnormal, and the status is set to abnormal. Result1, n11, n21 = (handle,"display device")# Query device information. # Check the power supply status (supported only by the AR2500 series). Handle, err_desp = () # Open a CLI channel. Subboard_status = 0 # Initialize the LPU status. Temp_status = 0 # Initialize the temperature status. Power_status = 0 # Initialize the power supply status.Įth_status = 0 # Initialize the Ethernet interface status. Status, err_str = o.timer.relative("t1",5) # Cyclic timer (5s) Monitor.py example import ops # Import the ops module.









Python process monitor