sonic-buildimage/device/ragile/x86_64-ragile_ra-b6910-64c-r0/systest.py
pettershao-ragilenetworks 8514a484cd
[platform/ragile] support ra-b6910-64c (#7950)
What I did it
Add new platform x86_64-ragile_ra-b6910-64c-r0 (Tomahawk 3)
ASIC Vendor: Broadcom
Switch ASIC: Tomahawk 3
Port Config: 64x100G

-How I did it
Provide device and platform related files.

-How to verify it
show platform fan
show platform ssdhealth
show platform psustatus
show platform summary
show platform syseeprom
show platform temperature
show interface status
2021-09-09 10:49:37 -07:00

44 lines
1.2 KiB
Python

#!/usr/bin/python3
# -*- coding: UTF-8 -*-
"""
* onboard temperature sensors
* FAN trays
* PSU
"""
import time
import datetime
from monitor import status
def doWork():
a=[];
'''
return: [{'status': '1', 'hw_version': '1.00', 'errcode': 0, 'fan_type': 'M6510-FAN-F', 'errmsg': 'OK', 'Speed': '9778', 'id': 'fan1', 'present': '0', 'sn': '1000000000014'},
{'id': 'fan2', 'errmsg': 'not present', 'errcode': -1},
{'id': 'fan3', 'errmsg': 'not present', 'errcode': -1},
{'id': 'fan4', 'errmsg': 'not present', 'errcode': -1}
]
description: 1.get id
2.errcode equal 0 : dev normal
not equal 0 : get errmsg
3.other message add when all check success
'''
status.checkFan(a)
#status.getTemp(a)
#status.getPsu(a)
nowTime=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print(nowTime)
print(a)
def run(interval):
while True:
try:
time_remaining = interval - time.time()%interval
time.sleep(time_remaining)
doWork()
except Exception as e:
print(e)
if __name__ == '__main__':
interval = 1
run(interval)