Générateur de conf Nagios

Brouillon

object configuration files

Voir :

Notes supervision Nagios

http://nagios.manubulon.com/traduction/docs14fr/xodtemplate.html#service

https://docs-older.centreon.com/docs/centreon-engine/en/latest/user/configuration/basics/object_definitions.html

https://github.com/NagiosEnterprises/nagioscore/tree/master/sample-config/template-object

https://github.com/pynag/pynag

MK Livestatus

NDOUtils

https://github.com/mclarkson/check_nagios_config

https://github.com/shriasi/nagiosconfigtocsv/tree/main

Fichiers plats à garder en statique :

commands.cfg

contacts.cfg

localhost.cfg

templates.cfg

timeperiods.cfg

Fichier à supprimer ou à regénérer :

printer.cfg

switch.cfg

windows.cfg

Types d'objets à générer :

host

hostgroup

service

servicegroup ?

Dans le conf par défaut nous avons les templates suivants pour les hosts

generic-host

linux-server

windows-server

generic-printer

generic-switch

et pour les services :

generic-service

local-service (utiliser que dans localhost.cfg)

Proposition de format YAML

--- hosts: - host_name: "srv1" use: "linux-server" alias: "Server 1" address: "192.168.1.10" - host_name: "hplj2605dn" use: "generic-printer" alias: "HP LaserJet 2605dn" address: "192.168.1.30" hostgroups: "network-printers" # Member of hostgroup - host_name: "winserver" use: "windows-server" # Template contains "hostgroups windows-servers" alias: "My Windows Server" address: "192.168.1.2" hostgroups: - hostgroup_name: "linux-servers" alias: "Linux Servers" # members: "srv1" # Member of hostgroup # hostgroup_members: - hostgroup_name: "network-printers" alias: "Network Printers" - hostgroup_name: "windows-servers" alias: "Windows Servers" services: - service_description: "SSH" use: "generic-service" hostgroup: "linux-remote-servers" check_command: "check_ssh" - service_description: "NSClient++ Version" use: "generic-service" host_name: "winserver" check_command: "check_nt!CLIENTVERSION" - service_description: Memory hostgroup_name: "linux-servers" check_command: "check_centreon_snmp_linux_mem!80!90" max_check_attempts: 1 normal_check_interval: 1 retry_check_interval: 1 check_period: "24x7" notification_interval: 2000 notification_period: "24x7" notification_options: "w,c,r" contact_groups: "support" event_handler: "trigger_memory"