Created
March 16, 2018 15:03
-
-
Save metabsd/f237f8bc0d0b3a05dd9cd699739d533c to your computer and use it in GitHub Desktop.
Add disk in Nagios XI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if response_ncpa['root']['disk']['logical'][logical_disk]['fstype'] in ('xfs', 'ext3', 'ext4'): | |
# Classify DBA FS | |
if re.match(ymlregex.get('dba'), logical_disk_parse) is not None: | |
if not check_monitoring_exist(server['name'],'Disk Usage on ' + logical_disk_parse): | |
payload_dba = {'host_name': str(server['name']), | |
'use': nagiosxi_template, | |
'service_description': 'Disk Usage on ' + logical_disk_parse, | |
'check_command': 'check_xi_ncpa!-t \'' + ymltoken.get( | |
'linux') + '\' -P 5693 -M \'disk/logical/' + logical_disk + '\' -u M -w 90 -c 95!!!!!!!', | |
'force': '1'} | |
post_json(ymlnagiosxi.get('add_services_url'), payload_dba) | |
# Classify Middleware FS | |
elif re.match(ymlregex.get('middle'), logical_disk_parse) is not None: | |
if not check_monitoring_exist(server['name'], 'Disk Usage on ' + logical_disk_parse): | |
payload_middle = {'host_name': str(server['name']), | |
'use': nagiosxi_template, | |
'service_description': 'Disk Usage on ' + logical_disk_parse, | |
'check_command': 'check_xi_ncpa!-t \'' + ymltoken.get( | |
'linux') + '\' -P 5693 -M \'disk/logical/' + logical_disk + '\' -u M -w 90 -c 95!!!!!!!', | |
'force': '1'} | |
post_json(ymlnagiosxi.get('add_services_url'), payload_middle) | |
# All other go to Unix Team | |
else: | |
if not check_monitoring_exist(server['name'], 'Disk Usage on ' + logical_disk_parse): | |
payload_unix = {'host_name': str(server['name']), | |
'use': nagiosxi_template, | |
'service_description': 'Disk Usage on ' + logical_disk_parse, | |
'check_command': 'check_xi_ncpa!-t \'' + ymltoken.get( | |
'linux') + '\' -P 5693 -M \'disk/logical/' + logical_disk + '\' -u M -w 90 -c 95!!!!!!!', | |
'force': '1'} | |
post_json(ymlnagiosxi.get('add_services_url'), payload_unix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment