量化感知一切IT设备: 使用脚本监控PDU

PDU: Power Distribution Unit 电源分配单元

在REMS2的实施过程中,我们遇到了这样的需求:
客户需要监控很多台PDU的指标,所使用的PDU有一个WEB访问接口,输入用户名和口令后可以进行PDU的远程操作和状态查看. PDU并没有SNMP服务之类功能.

该类型PDU能够提供4个监控指标: 电流,电压,功率,温度.
思路:
在Script中模拟浏览器访问(模拟用户名口令输入,查看指标页面), 对于获取到的HTML代码使用python进行处理.

效果:
$ ./mon_pdu.py -h

 

Usage: mon_pdu.py [options]

 

 

Options:
-h, --help show this help message and exit
-H HOST, --host=HOST pdu admin address
-p PORT, --port=PORT pdu admin port
-u USER, --user=USER pdu admin username
-P PASSWORD, --passwd=PASSWORD
pdu admin password
-i INDEX, --index=INDEX
return value using index

该python脚本接收5个参数, 分别是pdu的ip地址,管理端口(默认是80),用户名,口令和一个序号(0: 电流, 1: 电压, 2: 功率, 3: 温度)

监控温度:

./mon_pdu.py -H 192.168.0.109 -p 80 -u admin -P admin -i 3
0.0
监控功率:
./mon_pdu.py -H 192.168.0.109 -p 80 -u admin -P admin -i 2
9
监控电压:
./mon_pdu.py -H 192.168.0.109 -p 80 -u admin -P admin -i 1
227.4
监控电流:
./mon_pdu.py -H 192.168.0.109 -p 80 -u admin -P admin -i 0
0.0

126 Comments

  1. Pingback: crystals Adidas Precurved Strapback

  2. Pingback: nike insider pinterest.com

  3. Pingback: nike short sleeve compression top youtube.com

  4. Pingback: lebron 13 baby blue pinterest.com

  5. Pingback: duramo adidas slippers

  6. Pingback: nike air huarache nike all court 2 low

  7. Pingback: reebok zigtech shark 3.0 pure plat uk trainers

  8. Pingback: nike kd kd 8

  9. Pingback: 250 yeezy boost

  10. Pingback: 褉芯蟹芯胁褘泄 泻芯褉懈褔薪械胁褘泄 nike tennis classic

  11. Pingback: nike wmns free 50

  12. Pingback: uk trainers adidas nemeziz tango 17 hyper pink

  13. Pingback: voltio marr贸n nike air max guile

  14. Pingback: 銉娿偆銈?nike kobe icon 銉涖儻銈ゃ儓 銈枫儷銉愩兗

  15. Pingback: nike nike air force 1

  16. Pingback: nike dunk high top married to the mob twine white black shoes

  17. Pingback: kaki beige blanc onitsuka tiger mexico 66 lauta

  18. Pingback: womens adidas r2 pinterest.com

  19. Pingback: sort lyser酶d nike juvenate

  20. Pingback: uk trainers womens jordan 9 garnet

  21. Pingback: uk trainers nike mercurial superfly vi lotus red

  22. Pingback: crystal blinged out blinged out nike archive 75

  23. Pingback: wholesale mens jamaal williams 30 green bay packers jersey

  24. Pingback: adidas nemeziz messi 2018

  25. Pingback: adidas styling complements cropped pants branded feet

  26. Pingback: nike flyknit racer mens chlorine bluewhite dark obsidian

  27. Pingback: tiempo legacy 2 fg twitter.com

  28. Pingback: 1mb crystal candelabra with swarovski

  29. Pingback: asics gel lyte v holiday

  30. Pingback: autumn winter hat korean tidal mswarm winter hat ear knitted wool hat hot money belt buckle explosion models

  31. Pingback: air jordan 3 korea av8370 100 release date

  32. Pingback: emmuscades

  33. Pingback: resekipman

  34. Pingback: mens nike jacket nike asg hypermesh black grey university red

  35. Pingback: mens pajamas cotton pajamas bedhead pjs

  36. Pingback: ralfwentz

  37. Pingback: daftarkursus

  38. Pingback: inpaetest

  39. Pingback: jpstallard

  40. Pingback: myfraimz

  41. Pingback: zovailangnews

  42. Pingback: artikhazirsin

  43. Pingback: ciarahanna

  44. Pingback: phihochwei

  45. Pingback: donhowsuccess

  46. Pingback: meetingxs

  47. Pingback: praiseti

  48. Pingback: reprebates

  49. Pingback: nike air zoom pegasus 35 942855 601 medial

  50. Pingback: deedeephelps

  51. Pingback: sklroofing

  52. Pingback: mustard hat mens

  53. Pingback: latinphonics

  54. Pingback: nike elite will tukuafu jersey

  55. Pingback: crisgarrett

  56. Pingback: shahsmkj

  57. Pingback: normraeber

  58. Pingback: ankaralokanta

  59. Pingback: killersandbox

  60. Pingback: jaskcsun

  61. Pingback: filmtele

  62. Pingback: lbclubmitu

  63. Pingback: latest naked sports bike apple iphone 4 mobile cases and covers

  64. Pingback: astrokasa

  65. Pingback: black old school vans women

  66. Pingback: new vans classic slip shoes black white

  67. Pingback: spotmygadget

  68. Pingback: yankaripark

  69. Pingback: weaselskin

  70. Pingback: fotoversorger

  71. Pingback: umuttekelbayi

  72. Pingback: wvusigmakappa

  73. Pingback: zrxocphotos

  74. Pingback: joegauntlett

  75. Pingback: fiat car keychain for men and women cool car key

  76. Pingback: shackofstones

  77. Pingback: hamiltonhunt

  78. Pingback: image of rayban men s pilot aviator sunglasses

  79. Pingback: darkstories

  80. Pingback: black nike air max thea

  81. Pingback: panda love iphone 6 plus case cover for

  82. Pingback: gotopaycheck

  83. Pingback: running headbands

  84. Pingback: newest nike lebron 15 xv red black gold mens james

  85. Pingback: nike air max 90 x off white releasing holiday season

  86. Pingback: agedleadz

  87. Pingback: sheffieldclc

  88. Pingback: zgzllc

  89. Pingback: infoility

  90. Pingback: sethba

  91. Pingback: oakley canada discount code

  92. Pingback: freizeittrend

  93. Pingback: jaxon hats c crown crushable wool felt fedora hat

  94. Pingback: open international de squash de nantes tournament preview

  95. Pingback: lifepakused

  96. Pingback: haceryeni

  97. Pingback: lroyroofing

  98. Pingback: braun orange nike free 5.0 2014

  99. Pingback: exclusive john bostock the mind is a battlefield and if you can win that battle you can do anything

  100. Pingback: milkbarn baby footed romper grey zebra

  101. Pingback: sphygmic

  102. Pingback: tory burch chelsea logo medallion wedge women

  103. Pingback: r33plfry

  104. Pingback: rig mark basketball beanie

  105. Pingback: blue light blocking glasses round frame navy frost great for men and

  106. Pingback: freetress equal fullcap drawstring half wig style girlom8643

  107. Pingback: air max 95 near me footshop

  108. Pingback: startnimble

  109. Pingback: womens speedy louis vuitton damier

  110. Pingback: kate spade jeweled cool cat iphone 6 phone case whimsical home decor kate spade

  111. Pingback: suede tie choker

  112. Pingback: supreme jacquard snake camp cap style engine

  113. Pingback: zpackrat

  114. Pingback: zemservise

  115. Pingback: paypalwar

  116. Pingback: when purchasing hair extensions you will see a few terms such as virgin hair remy hair human hair non remy hair and heat resistant hair

  117. Pingback: magicstockdz

  118. Pingback: mwsuperstore

  119. Pingback: hrubinlaser

  120. Pingback: shoes soccer mizuno

  121. Pingback: entrustengage

  122. Pingback: domcilios

  123. Pingback: millsbulb

  124. Pingback: tomtaylorblog

  125. Pingback: khalataxi

  126. Pingback: mengenmetal

Leave Comment