zabbix ajout auto
This commit is contained in:
parent
eaf75de89e
commit
d75f4ffb3f
@ -1,2 +1,3 @@
|
||||
SERVER: "127.0.0.1"
|
||||
SERVERACTIVE: "172.16.0.8"
|
||||
SERVERACTIVE: "192.168.99.8"
|
||||
TOKENAPI: "f72473b7e5402a5247773e456f3709dcdd5e41792360108fc3451bbfeed8eafe"
|
||||
|
@ -28,6 +28,11 @@
|
||||
state: restarted
|
||||
enabled: yes
|
||||
|
||||
#- name: remonter les machines
|
||||
#command: curl -X POST -H "Content-Type: application/json" -d '{ "jsonrpc":"2.0","method":"host.create","params": {"host": "s-itil","groups": [{"groupid": "6"}],"templates": [{"templateid": "10343"}],"inventory_mode": 0,"inventory": {"type": 0}},"auth": "a44e2a4977d61a869437739cb6086ae42f4b9937fbb96aed24bbad028469a1cf","id": 1}' http://192.168.99.8/zabbix/api_jsonrpc.php
|
||||
- name: mise ne place script hostcreate
|
||||
template:
|
||||
src: hostcreate.sh.j2
|
||||
dest: /tmp/hostcreate.sh
|
||||
|
||||
- name: lancement script hostcreate
|
||||
command: bash /tmp/hostcreate.sh
|
||||
|
||||
|
1
roles/zabbix-cli/templates/hostcreate.sh.j2
Normal file
1
roles/zabbix-cli/templates/hostcreate.sh.j2
Normal file
@ -0,0 +1 @@
|
||||
curl -X POST -H "Content-Type: application/json" -d '{ "jsonrpc":"2.0","method":"host.create","params": {"host": "{{ ansible_hostname }}","groups": [{"groupid": "6"}],"templates": [{"templateid": "10343"}],"inventory_mode": 0,"inventory": {"type": 0}},"auth": "{{ TOKENAPI }}","id": 1}' http://{{ SERVERACTIVE }}/zabbix/api_jsonrpc.php
|
Loading…
x
Reference in New Issue
Block a user