apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: '18'
This file contains 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
Ansible JMESPATH / JSON Explorer | |
nagios_xi_services.json.servicelist.service[?service_description=='Service Status: Filebeat'].host_name | |
I want to run a task when the result is empty only. | |
Example of data I register by module uri in nagios_xi_services | |
{ | |
"nagios_xi_services": { |
This file contains 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
- name: Monitoring Filebeat Service | |
uri: | |
url: 'https://{{ nagios_server }}/nagiosxi/api/v1/config/service?apikey={{ nagios_api_key }}' | |
body: 'host_name={{ ansible_nodename }}&service_description={{ nagios_service_description }}&use={{ nagios_filebeat_template }}&force=1' | |
status_code: 200 | |
method: POST | |
return_content: yes | |
validate_certs: no | |
timeout: 120 | |
delegate_to: 127.0.0.1 |
This file contains 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
tasks: | |
- name: add a new disk on guest vm | |
vmware_guest: | |
hostname: "{{ vcenter_hostname }}" | |
user: "{{ vcenter_username }}" | |
password: "{{ vcenter_password }}" | |
datacenter: "{{ vcenter_datacenter }}" | |
cluster: "{{ vcenter_cluster }}" | |
guest_id: "rhel7_64Guest" | |
validate_certs: False |
This file contains 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
I setup the variable. | |
- name: Set Nagios XI Services Facts | |
uri: | |
url: 'https://{{ nagios_server }}/nagiosxi/api/v1/objects/service?apikey={{ nagios_api_key }}&host_name=in:{{ ansible_play_hosts | join(",") }}' | |
status_code: 200 | |
method: GET | |
return_content: yes | |
validate_certs: no | |
headers: |
This file contains 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
ok: [zltxct0863] => { | |
"nagios_xi_services.json.servicelist.service|selectattr('service_description', 'search', nagios_cpu_usage_service_description)|list": [ | |
{ | |
"@attributes": { | |
"id": "24244" | |
}, | |
"action_url": "", | |
"active_checks_enabled": "1", | |
"check_interval": "15", | |
"config_type": "1", |
This file contains 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'} |
This file contains 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
- name: Monitoring Disk Usage | |
vars: | |
fstype: | |
- xfs | |
- ext4 | |
- ext3 | |
debug: msg="Adding Monitoring to {{ item.mount }}" | |
with_items: ansible_mounts | |
when: fstype in item.fstype |
This file contains 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
--- | |
#- hosts: en_utilisation:installed:&linux_red_hat:!production | |
- hosts: en_utilisation:installed:&sldadm* | |
- name: test for available disk space | |
assert: | |
that: | |
- not {{ item.mount == '/usr' and ( item.size_total <= 5368709120 ) }} | |
- not {{ item.mount == '/var' and ( item.size_total <= 5368709120 ) }} | |
msg: "{{ item.mount }} must be more than 5G" | |
with_items: "{{ ansible_mounts }}" |
This file contains 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
URL : | |
https://kibana.domain.name:5601/api/reporting/generate/printablePdf?jobParams=(browserTimezone:America%2FToronto,layout:(id:print),objectType:dashboard,queryString:%27_a%3D(description:!%27!%27,filters:!!(),fullScreenMode:!!f,options:(darkTheme:!!f,hidePanelTitles:!!f,useMargins:!!t),panels:!!((gridData:(h:3,i:!%271!%27,w:6,x:0,y:0),id:!%27429a2060-fa0f-11e7-b9c9-f5587aa8afb7!%27,panelIndex:!%271!%27,type:visualization,version:!%276.1.1!%27),(gridData:(h:3,i:!%272!%27,w:6,x:6,y:0),id:!%2707f5a070-fa13-11e7-b9c9-f5587aa8afb7!%27,panelIndex:!%272!%27,type:visualization,version:!%276.1.1!%27),(gridData:(h:3,i:!%273!%27,w:6,x:0,y:3),id:!%27953aa2a0-fa13-11e7-b9c9-f5587aa8afb7!%27,panelIndex:!%273!%27,type:visualization,version:!%276.1.1!%27),(gridData:(h:3,i:!%274!%27,w:6,x:6,y:3),id:a5c408a0-fa13-11e7-b9c9-f5587aa8afb7,panelIndex:!%274!%27,type:visualization,version:!%276.1.1!%27),(gridData:(h:3,i:!%275!%27,w:6,x:0,y:6),id:f5ed6d30-fa13-11e7-b9c9-f5587aa8afb7,panelIndex:!%275!%27,type:visualization,versio |
OlderNewer