Changeset 11053 in genesis for tools


Ignore:
Timestamp:
May 31, 2012, 2:00:47 AM (13 years ago)
Author:
rick
Message:

Cleanups & Data verzamelen.

Nu we hier zijn, ook eens kijken naar de wl_release (svn version) of het image
was gedeployt is, dit zou wel eens makkelijk kunnen zijn om updates en versie
beheer van de nodes beter te administreren en detecteren.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/check-batch-cmd

    r10892 r11053  
    1111import os
    1212import paramiko
     13import subprocess
    1314import socket
    1415import sys
     
    6970      raise CmdError((stderr, stdout))
    7071    return stdout
    71   except socket.error, e:
     72  except (socket.error, paramiko.AuthenticationException) as e:
    7273    raise ConnectError(e)
    7374
     
    9596
    9697def node_check(host):
     98  """ Using multiple connect methods to do some basic health checking as well"""
     99
    97100  print "# Processing host", host
    98101  datadump = gformat.get_yaml(host)
     
    125128      except CmdError, e:
    126129        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
    127137  gformat.store_yaml(datadump)
    128138
Note: See TracChangeset for help on using the changeset viewer.