- Timestamp:
- May 31, 2012, 2:00:47 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/check-batch-cmd
r10892 r11053 11 11 import os 12 12 import paramiko 13 import subprocess 13 14 import socket 14 15 import sys … … 69 70 raise CmdError((stderr, stdout)) 70 71 return stdout 71 except socket.error,e:72 except (socket.error, paramiko.AuthenticationException) as e: 72 73 raise ConnectError(e) 73 74 … … 95 96 96 97 def node_check(host): 98 """ Using multiple connect methods to do some basic health checking as well""" 99 97 100 print "# Processing host", host 98 101 datadump = gformat.get_yaml(host) … … 125 128 except CmdError, e: 126 129 print "### Command error: %s" % e 130 131 try: 132 wl_release = subprocess.check_output(['snmpget', '-Oq', '-Ov', '-c', 'public', '-v2c', 133 host, 'UCD-SNMP-MIB::ucdavis.84.4.1.2.6.119.108.45.118.101.114.1']) 134 datadump['wl_release'] = int(wl_release.replace('"','')) 135 except subprocess.CalledProcessError, ValueError: 136 pass 127 137 gformat.store_yaml(datadump) 128 138
Note:
See TracChangeset
for help on using the changeset viewer.