source: genesis/tools/active.py@ 10565

Last change on this file since 10565 was 10565, checked in by richardvm, 13 years ago

generate a list of active systems

  • Property svn:executable set to *
File size: 691 bytes
Line 
1#!/usr/bin/env python
2#
3# Script to create nagios output files from gformat configurtion files
4#
5# Original: Richard van Mansom <richardvm@wirelessleiden.nl>
6# Rick van der Zwet <rick@wirelessleiden.nl>
7
8import gformat
9
10def is_iris(node):
11 return node.has_key('release') and node['release'] in ['8.0-RELEASE', '7.2-RELEASE', '8.1-RELEASE', '8.2-RELEASE', '9.0-RELEASE']
12
13def is_up(datadump):
14 return datadump['status'] == 'up'
15
16if __name__ == '__main__':
17 # Process all hosts
18 for host in gformat.get_hostlist():
19 datadump = gformat.get_yaml(host)
20
21 # Make sure to process only active IRIS nodes
22 if not is_iris(datadump) or not is_up(datadump):
23 continue
24
25 print host
26
Note: See TracBrowser for help on using the repository browser.