Personal tools
You are here: Home メンバー 菊地時夫 メモ サーバモニタ
Document Actions

サーバモニタ

by 菊地時夫 posted at 2008-07-28 17:03 last modified 2008-07-28 17:03

XServe のサーバモニタのデータは、https://xserve.example.com:311/ から読み出すことができるようだ。

管理権限を持った username/password が必要なので、不用意に外からアクセスできるようになってたりするとアウトだな。

こんな感じ

import httplib
import base64
cmd = '/commands/servermgr_xserve?input=<%3Fxml+version%3D"1.0"'   \
      '+encoding%3D"UTF-8"%3F>%0D%0A<plist+version%3D"0.9">%0D%0A' \
      '<dict>%0D%0A%09<key>command<%2Fkey>%0D%0A%09<string>status' \
      '<%2Fstring>%0D%0A<%2Fdict>%0D%0A<%2Fplist>%0D%0A'           \
      '&send=Send+Command'
c = httplib.HTTPSConnection('xserve.example.com', 311)
user = 'administrator'
pswd = 'topsecretpassword'
cred = base64.encodestring('%s:%s' % (user, pswd))
headers = {'Authorization': 'Basic %s' % cred}
c.request('GET', cmd, headers=headers)
r = c.getresponse()
print r.status, r.reason
for k,v in r.getheaders():
    print '%s: %s' % (k,v)
print
d = r.read()
print d
c.close()

Category(s)
なんでも
The URL to Trackback this entry is:
http://sango.lab.tkikuchi.net/Members/tkikuchi/30e130e2/30b530fc30e230cb30bf/tbping
« December 2010 »
Su Mo Tu We Th Fr Sa
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
About this blog
メモ代わりのブログ
Recent entries
JIS を戻すって tkikuchi 2010-06-14
ゼネラリスト tkikuchi 2010-04-26
Solaris 10 で 64bit tkikuchi 2010-04-11
なんかマヌケ? tkikuchi 2010-02-22
Oracle + ASP.NET なんですね tkikuchi 2010-01-28
Recent comments
Re:lock できないので tkikuchi 2009-06-03
Re:挨拶用メモ tkikuchi 2009-05-27
Re:挨拶用メモ knakahasi 2009-05-04
Re:Xgrid (続編) tkikuchi 2008-10-09
PILでのグラフ出力 ytoshio 2008-03-06
Categories
なんでも
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: