main.yml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ---
  2. - name: Install NRPE-Server
  3. package:
  4. name: nagios-nrpe-server
  5. state: latest
  6. - name: Configure NRPE-Server
  7. template: "src=nrpe_local.cfg.j2 dest='/etc/nagios/nrpe_local.cfg' owner=root group=root"
  8. - name: Install Nagios Plugins
  9. package:
  10. name: nagios-plugins-standard
  11. state: latest
  12. - name: Install bc
  13. package:
  14. name: bc
  15. state: latest
  16. - name: Install vnstat
  17. package:
  18. name: vnstat
  19. state: latest
  20. - name: Install vnstati
  21. package:
  22. name: vnstati
  23. state: latest
  24. - name: Install RAM check
  25. copy: "src=check_ram dest='/usr/lib/nagios/plugins/check_ram' owner=root group=root mode=a+x"
  26. - name: Install bandwith check
  27. copy: "src=check_bandwidth dest='/usr/lib/nagios/plugins/check_bandwidth' owner=root group=root mode=a+x"
  28. - name: Install check_eth
  29. copy: "src=check_eth dest='/usr/lib/nagios/plugins/check_eth' owner=root group=root mode=a+x"
  30. - name: Install check_systemd_service
  31. copy: "src=check_systemd_service dest='/usr/lib/nagios/plugins/check_systemd_service' owner=root group=root mode=a+x"
  32. - name: Install check_tunneldigger
  33. copy: "src=check_tunneldigger dest='/usr/lib/nagios/plugins/check_tunneldigger' owner=root group=root mode=a+x"
  34. - name: Install Speedtest
  35. package:
  36. name: speedtest-cli
  37. state: latest
  38. - name: Install check_speedtest-cli plugin
  39. copy: src=check_speedtest-cli.sh dest=/usr/lib/nagios/plugins/check_speedtest-cli.sh owner=root group=root mode=a+x
  40. - name: Install DHCP lease check
  41. copy: "src=check_active-leases dest='/usr/lib/nagios/plugins/check_active-leases' owner=root group=root mode=a+x"
  42. - name: Install check_batip
  43. copy: "src=check_batip dest='/usr/lib/nagios/plugins/check_batip' owner=root group=root mode=a+x"
  44. - name: Install check_batip6
  45. copy: "src=check_batip6 dest='/usr/lib/nagios/plugins/check_batip6' owner=root group=root mode=a+x"
  46. - name: Install check_iproute
  47. copy: "src=check_iproute dest='/usr/lib/nagios/plugins/check_iproute' owner=root group=root mode=a+x"
  48. - name: Install check_iproute6
  49. copy: "src=check_iproute6 dest='/usr/lib/nagios/plugins/check_iproute6' owner=root group=root mode=a+x"
  50. - name: Install check_bird_sessions
  51. copy: "src=check_bird_sessions dest='/usr/lib/nagios/plugins/check_bird_sessions' owner=root group=root mode=a+x"
  52. - name: Install check_bird6_sessions
  53. copy: "src=check_bird6_sessions dest='/usr/lib/nagios/plugins/check_bird6_sessions' owner=root group=root mode=a+x"
  54. - name: Sudo Recht check_bird_sessions
  55. lineinfile: dest=/etc/sudoers line='nagios ALL=NOPASSWD{{ ":" }} /usr/lib/nagios/plugins/check_bird_sessions' state=present
  56. - name: Sudo Recht check_bird6_sessions
  57. lineinfile: dest=/etc/sudoers line='nagios ALL=NOPASSWD{{ ":" }} /usr/lib/nagios/plugins/check_bird6_sessions' state=present
  58. - name: Sudo Recht check_FFTester
  59. lineinfile: dest=/etc/sudoers line='nagios ALL=NOPASSWD{{ ":" }} /root/gits/tools/Freifunk-Tester/icinga_reporter.sh' state=present
  60. when: is_ff_tester is defined
  61. - name: stop NRPE-Server
  62. service:
  63. name: nagios-nrpe-server
  64. state: stopped
  65. - name: start NRPE-Server
  66. service:
  67. name: nagios-nrpe-server
  68. state: started