-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcentreon.yml
113 lines (105 loc) · 3.6 KB
/
centreon.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
# Testing playbook.... use with VM
- hosts: localhost
vars:
centreon_url: "http://192.168.189.138/centreon"
centreon_api_user: "admin"
centreon_api_pass: "centreon"
tasks:
- name: Add Command to Centreon
centreon_command:
url: "{{ centreon_url }}"
username: "{{ centreon_api_user }}"
password: "{{ centreon_api_pass }}"
name: "App-DB-Redis-cli-clients"
type: "check"
line: |
$CENTREONPLUGINS$/centreon_redis_cli.pl --plugin=apps::redis::cli::plugin --mode=clients --hostname=$HOSTADDRESS$ --port='$_HOSTREDISPORT$' --username='$_HOSTREDISUSERNAME$' --password='$_HOSTREDISPASSWORD$' --warning-connected-clients='$_SERVICEWARNINGCONNECTEDCLIENTS$' --critical-connected-clients='$_SERVICECRITICALCONNECTEDCLIENTS$' --warning-blocked-clients='$_SERVICEWARNINGBLOCKEDCLIENTS$' --critical-blocked-clients='$_SERVICECRITICALBLOCKEDCLIENTS$' --warning-client-longest-output-list='$_SERVICEWARNINGLONGESTOUTPUTLIST$' --critical-client-longest-output-list='$_SERVICECRITICALLONGESTOUTPUTLIST$' --warning-client-biggest-input-buf='$_SERVICEWARNINGBIGGESTINPUTBUFF$' --critical-client-biggest-input-buf='$_SERVICECRITICALBIGGESTINPUTBUFF$'
delegate_to: localhost
notify: "centreon api applycfg"
tags:
- command
- hosts: localhost
vars:
centreon_url: "http://192.168.189.138/centreon"
centreon_api_user: "admin"
centreon_api_pass: "centreon"
tasks:
- name: Add Host to Centreon
centreon_host:
url: "{{ centreon_url }}"
username: "{{ centreon_api_user }}"
password: "{{ centreon_api_pass }}"
name: "host_testt"
alias: "test"
ipaddr: "127.0.0.1"
hosttemplates:
- name: App-DB-MySQL
- name: HW-Printer-standard-rfc3805-custom
- name: HW-UPS-Standard-Rfc1628-SNMP
state: absent
hostgroups:
- name: hg_test
state: absent
- name: hg9
#instance: Central
status: enabled
state: present
params:
- name: notes_url
value: "https://wiki.company.org/servers/{{ ansible_fqdn }}"
- name: notes
value: "My Best server 2"
macros:
- name: "$_HOSTTEST$"
value: value1_up
is_password: 0
- name: FOO
value: bar
description: description1
state: absent
# - name: "$_HOSTSNMPCOMMUNITY$"
# value: "snmp_secret"
# - name: "$_HOSTTEST$"
# value: "supertest"
# - name: macropass
# value: mysecretpassword
# is_password: 1
# description: "shut..."
applycfg: False
delegate_to: localhost
tags:
- hosts
- hosts: localhost
vars:
centreon_url: "http://192.168.189.138/centreon"
centreon_api_user: "admin"
centreon_api_pass: "centreon"
tasks:
- name: Add Host to Centreon
centreon_hostgroup:
url: "{{ centreon_url }}"
username: "{{ centreon_api_user }}"
password: "{{ centreon_api_pass }}"
hg:
- name: "hg_ansible"
alias: "test"
- name: "hg_not_alias"
state: absent
tags:
- hg
- hosts: localhost
vars:
centreon_url: "http://192.168.189.138/centreon"
centreon_api_user: "admin"
centreon_api_pass: "centreon"
tasks:
- name: Apply Config on poller
centreon_poller:
url: "{{ centreon_url }}"
username: "{{ centreon_api_user }}"
password: "{{ centreon_api_pass }}"
instance: "Central"
action: "applycfg"
tags:
- poller