2700 admin@mtbc-sonic-03-2700:~$ python Python 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import fanutil fan = fanutil.FanUtil() >>> fan = fanutil.FanUtil() num = fan.get_num_fans() for i in range(1,num+2): print i fan.get_status(i) fan.get_presence(i) fan.get_direction(i) fan.get_speed(i) import psuutil psu = psuutil.PsuUtil() num = psu.get_num_psus() for i in range(1,num+2): print i psu.get_psu_status(i) psu.get_psu_presence(i) psu.get_output_voltage(i) psu.get_output_current(i) psu.get_output_power(i) psu.get_fan_speed(i,1) >>> num = fan.get_num_fans() >>> for i in range(1,num+2): ... print i ... fan.get_status(i) ... fan.get_presence(i) ... fan.get_direction(i) ... fan.get_speed(i) ... 1 True True 'N/A' 10948 2 True True 'N/A' 12448 3 True True 'N/A' 10691 4 True True 'N/A' 12562 5 True True 'N/A' 10861 6 True True 'N/A' 12562 7 True True 'N/A' 10775 8 True True 'N/A' 12562 9 Traceback (most recent call last): File "", line 3, in File "fanutil.py", line 117, in get_status if not self.get_presence(index): File "fanutil.py", line 131, in get_presence raise RuntimeError("index ({}) shouldn't be greater than number of fans ({})".format(index, self.num_of_fan)) RuntimeError: index (9) shouldn't be greater than number of fans (8) >>> import psuutil >>> psu = psuutil.PsuUtil() >>> num = psu.get_num_psus() >>> for i in range(1,num+2): ... print i ... psu.get_psu_status(i) ... psu.get_psu_presence(i) ... psu.get_output_voltage(i) ... psu.get_output_current(i) ... psu.get_output_power(i) ... psu.get_fan_speed(i,1) ... 1 True True 12019 4625 55562500 10368 2 True True 12023 5375 64625000 10288 3 Traceback (most recent call last): File "", line 3, in File "psuutil.py", line 93, in get_psu_status raise RuntimeError("index ({}) shouldn't be greater than {}".format(index, self.MAX_NUM_PSU)) RuntimeError: index (3) shouldn't be greater than 2 >>> 2100 admin@arc-switch1029:~$ python Python 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import fanutil >>> fan = fanutil.FanUtil() num = fan.get_num_fans() for i in range(1,num+2): print i fan.get_status(i) fan.get_presence(i) fan.get_direction(i) fan.get_speed(i) >>> num = fan.get_num_fans() >>> for i in range(1,num+2): ... print i ... fan.get_status(i) ... fan.get_presence(i) ... fan.get_direction(i) ... fan.get_speed(i) ... 1 True True 'N/A' 17396 2 True True 'N/A' 16324 3 True True 'N/A' 16324 4 True True 'N/A' 15028 5 Traceback (most recent call last): File "", line 3, in File "fanutil.py", line 117, in get_status if not self.get_presence(index): File "fanutil.py", line 131, in get_presence raise RuntimeError("index ({}) shouldn't be greater than number of fans ({})".format(index, self.num_of_fan)) RuntimeError: index (5) shouldn't be greater than number of fans (4) >>> admin@mtbc-3700c-01:~$ python Python 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import fanutil fan = fanutil.FanUtil() >>> fan = fanutil.FanUtil() num = fan.get_num_fans() for i in range(1,num+2): print i fan.get_status(i) fan.get_presence(i) fan.get_direction(i) fan.get_speed(i) import psuutil psu = psuutil.PsuUtil() num = psu.get_num_psus() for i in range(1,num+2): print i psu.get_psu_status(i) >>> num = fan.get_num_fans() >>> for i in range(1,num+2): ... print i ... fan.get_status(i) ... fan.get_presence(i) ... fan.get_direction(i) ... fan.get_speed(i) ... 1 True True 'intake' 14403 2 True True 'intake' 12620 3 True True 'intake' 14097 4 True True 'intake' 12620 5 True True 'intake' 14561 6 True True 'intake' 12741 7 True True 'intake' 14248 8 True True 'intake' 12620 9 Traceback (most recent call last): File "", line 3, in File "fanutil.py", line 117, in get_status if not self.get_presence(index): File "fanutil.py", line 131, in get_presence raise RuntimeError("index ({}) shouldn't be greater than number of fans ({})".format(index, self.num_of_fan)) RuntimeError: index (9) shouldn't be greater than number of fans (8) >>> import psuutil >>> psu = psuutil.PsuUtil() psu.get_psu_presence(i) psu.get_output_voltage(i) psu.get_output_current(i) psu.get_output_power(i) psu.get_fan_speed(i,1) >>> num = psu.get_num_psus() >>> for i in range(1,num+2): ... print i ... psu.get_psu_status(i) ... psu.get_psu_presence(i) ... psu.get_output_voltage(i) ... psu.get_output_current(i) ... psu.get_output_power(i) ... psu.get_fan_speed(i,1) ... 1 False True 0 0 0 0 2 True True 12050 18625 237250000 14560 3 Traceback (most recent call last): File "", line 3, in File "psuutil.py", line 93, in get_psu_status raise RuntimeError("index ({}) shouldn't be greater than {}".format(index, self.MAX_NUM_PSU)) RuntimeError: index (3) shouldn't be greater than 2 >>>