5 SNMP
agentAddress udp::161 #view systemonly included .1.3.6.1.2.1.1 #view systemonly included .1.3.6.1.2.1.25.1 rocommunity duchmol72 #defaultMonitors yes
# This file controls the activity of snmpd and snmptrapd # Don't load any MIBs by default. # You might comment this lines once you have the MIBs downloaded. export MIBDIRS=/usr/share/snmp/mibs export MIBS=ALL # snmpd control (yes means start daemon). SNMPDRUN=yes # snmpd options (use syslog, close stdin/out/err). SNMPDOPTS='-LS4d -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid' # snmptrapd control (yes means start daemon). As of net-snmp version # 5.0, master agentx support must be enabled in snmpd before snmptrapd # can be run. See snmpd.conf(5) for how to do this. TRAPDRUN=yes # snmptrapd options (use syslog). TRAPDOPTS='-On -Lsd -p /var/run/snmptrapd.pid' # create symlink on Debian legacy location to official RFC path SNMPDCOMPAT=yes
service snmpd restart Restarting network management services: snmpd snmptrapd.
6 Première configuration Centreon
![Stacks Image 7287](files/stacks-image-770b739.png)
chmod + x create_macrocustom.sh
6.1 Création des macros personnalisées
./create_macrocustom.sh _HOSTSNMPVERSION duchmol72 Central "Custom Macro" ./create_macrocustom.sh _HOSTSNMPCOMMUNITY 2c Central "Custom Macro" ./create_macrocustom.sh _SERVICEWARNING 0 Central "Custom Macro" ./create_macrocustom.sh _SERVICECRITICAL 0 Central "Custom Macro" ./create_macrocustom.sh _SERVICEPACKETNUMBER 0 Central "Custom Macro" ./create_macrocustom.sh _SERVICEPROCESS 0 Central "Custom Macro" ./create_macrocustom.sh _SERVICEINTERFACE 0 Central "Custom Macro" ./create_macrocustom.sh _SERVICEPASSWORD 0 Central "Custom Macro" ./create_macrocustom.sh _SERVICEUSERNAME 0 Central "Custom Macro" ./create_macrocustom.sh _SERVICEMODE_MYSQL 0 Central "Custom Macro" ./create_macrocustom.sh _SERVICEPORT 0 Central "Custom Macro" ./create_macrocustom.sh _SERVICEDISK 0 Central "Custom Macro"
6.2 Modification du template Hôte générique
cd /usr/local/centreon/www/modules/centreon-clapi/core ./centreon -u admin -p password -o HTPL -a setparam -v "generic-host;host_max_check_attempts;3" ./centreon -u admin -p password -o HTPL -a setparam -v "generic-host;host_check_interval;5" ./centreon -u admin -p password -o HTPL -a setparam -v "generic-host;host_retry_check_interval;2" ./centreon -u admin -p password -o HTPL -a setparam -v "generic-host;host_notifications_enabled;2" ./centreon -u admin -p password -o STPL -a delhost -v "Ping-LAN;generic-host"
6.4 Création du modèle de Notification 24x7
./centreon -u admin -p password -o HTPL -a add -v "notification-24x7;notification-24x7;;;Central;" ./centreon -u admin -p password -o HTPL -a setparam -v "notification-24x7;host_notifications_enabled;1" ./centreon -u admin -p password -o HTPL -a addcontactgroup -v "notification-24x7;Supervisors" ./centreon -u admin -p password -o HTPL -a setparam -v "notification-24x7;host_notification_interval;0" ./centreon -u admin -p password -o HTPL -a setparam -v "notification-24x7;notification_period;24x7" ./centreon -u admin -p password -o HTPL -a setparam -v "notification-24x7;host_notification_options;d,r,f" ./centreon -u admin -p password -o HTPL -a setparam -v "notification-24x7;host_first_notification_delay;0"
6.5 Création des autres templates
./centreon -u admin -p password -o HTPL -a add -v "OS-Linux-Debian7;Modele OS Linux Debian 7;;;Central;" ./centreon -u admin -p password -o HTPL -a add -v "Linux-WEB;Modele Web Linux;;;Central;" ./centreon -u admin -p password -o HTPL -a add -v "Linux-MySQL;Modele MySQL;;;Central;" ./centreon -u admin -p password -o HTPL -a add -v "Linux-DNS;Modele Linux DNS;;;Central;" ./centreon -u admin -p password -o HTPL -a add -v "Linux-LDAP;Modele Linux LDAP;;;Central;" ./centreon -u admin -p password -o HTPL -a add -v "Linux-MAIL;Modele Linux MAIL;;;Central;"
6.6 Création des commandes
./centreon -u admin -p password -o CMD -a ADD -v 'check_ping;check;$USER1$/check_icmp -H $HOSTADDRESS$ -n $_SERVICEPACKETNUMBER$ -w $_SERVICEWARNING$ -c $_SERVICECRITICAL$'
./centreon -u admin -p password -o CMD -a setparam -v "check_ping;graph;Latency"
./centreon -u admin -p password -o CMD -a ADD -v 'check_disk_SNMP;check;$USER1$/check_centreon_snmp_remote_storage -H $HOSTADDRESS$ -n -d $_SERVICEDISK$ -w $_SERVICEWARNING$ -c $_SERVICECRITICAL$ -v $_HOSTSNMPVERSION$ -C $_HOSTSNMPCOMMUNITY$'
./centreon -u admin -p password -o CMD -a setparam -v "check_disk_SNMP;graph;Storage"
./centreon -u admin -p password -o CMD -a ADD -v 'check_snmp_load;check;$USER1$/check_centreon_snmp_loadaverage -H $HOSTADDRESS$ -v $_HOSTSNMPVERSION$ -C $_HOSTSNMPCOMMUNITY$ -w $_SERVICEWARNING$ -c $_SERVICECRITICAL$'
./centreon -u admin -p password -o CMD -a setparam -v "check_snmp_load;graph;Load_Average"
./centreon -u admin -p password -o CMD -a ADD -v 'check_snmp_cpu;check;$USER1$/check_centreon_snmp_cpu -H $HOSTADDRESS$ -w $_SERVICEWARNING$ -c $_SERVICECRITICAL$ -v $_HOSTSNMPVERSION$ -C $_HOSTSNMPCOMMUNITY$'
./centreon -u admin -p password -o CMD -a setparam -v "check_snmp_cpu;graph;CPU"
./centreon -u admin -p password -o CMD -a ADD -v 'check_snmp_process;check;$USER1$/check_centreon_snmp_process -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$ -v $_HOSTSNMPVERSION$ -p $_SERVICEPROCESS$'
./centreon -u admin -p password -o CMD -a ADD -v 'check_snmp_process_multiple;check;$USER1$/check_centreon_snmp_process_detailed -H $HOSTADDRESS$ -C $_HOSTSNMPCOMMUNITY$ -n $_SERVICEPROCESS$ -w $_SERVICECRITICAL$ -c $_SERVICECRITICAL$'
./centreon -u admin -p password -o CMD -a ADD -v 'check_traffic;check;$USER1$/check_centreon_snmp_traffic -H $HOSTADDRESS$ -n -i $_SERVICEINTERFACE$ -w $_SERVICEWARNING$ -c $_SERVICECRITICAL$ -v $_HOSTSNMPVERSION$ -C $_HOSTSNMPCOMMUNITY$'
./centreon -u admin -p password -o CMD -a setparam -v "check_traffic;graph;Traffic"
./centreon -u admin -p password -o CMD -a DEL -v "check_tcp"
./centreon -u admin -p password -o CMD -a ADD -v 'check_tcp;check;$USER1$/check_tcp -H $HOSTADDRESS$ -p $_SERVICEPORT$ -w $_SERVICEWARNING$ -c $_SERVICECRITICAL$'
./centreon -u admin -p password -o CMD -a setparam -v "check_tcp;graph;Latency"
6.7 Création des modèles de services
6.7a Création du modèle service-generique-actif
./centreon -u admin -p password -o STPL -a add -v "service-generique-actif;service-generique-actif;" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;check_period;24x7" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;max_check_attempts;3" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;normal_check_interval;5" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;retry_check_interval;2" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;active_checks_enabled;1" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;passive_checks_enabled;0" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;notifications_enabled;1" ./centreon -u admin -p password -o STPL -a addcontactgroup -v "service-generique-actif;Supervisors" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;notification_interval;0" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;notification_period;24x7" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;notification_options;w,c,r,f,s" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-actif;first_notification_delay;0"
6.7b Création du modèle PING
./centreon -u admin -p password -o STPL -a add -v "modele ping;PING;service-generique-actif" ./centreon -u admin -p password -o STPL -a setparam -v "modele ping;check_command;check_ping" ./centreon -u admin -p password -o STPL -a setmacro -v "modele ping;PACKETNUMBER;3" ./centreon -u admin -p password -o STPL -a setmacro -v "modele ping;WARNING;200,20%" ./centreon -u admin -p password -o STPL -a setmacro -v "modele ping;CRITICAL;400,50%" ./centreon -u admin -p password -o STPL -a addhost -v "modele ping;generic-host"
6.7c Création des modèles DISK_SNMP
./centreon -u admin -p password -o STPL -a add -v "modele disque SNMP;Disk_SNMP;service-generique-actif" ./centreon -u admin -p password -o STPL -a setparam -v "modele disque SNMP;check_command;check_disk_SNMP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele disque SNMP;WARNING;80" ./centreon -u admin -p password -o STPL -a setmacro -v "modele disque SNMP;CRITICAL;90" ./centreon -u admin -p password -o STPL -a add -v "modele disque SNMP root;Disk_SNMP_root;modele disque SNMP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele disque SNMP root;DISK;/" ./centreon -u admin -p password -o STPL -a add -v "modele disque SNMP boot;Disk_SNMP_boot;modele disque SNMP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele disque SNMP boot;DISK;/boot" ./centreon -u admin -p password -o STPL -a add -v "modele disque SNMP var;Disk_SNMP_var;modele disque SNMP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele disque SNMP var;DISK;/var" ./centreon -u admin -p password -o STPL -a add -v "modele disque SNMP tmp;Disk_SNMP_tmp;modele disque SNMP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele disque SNMP tmp;DISK;/tmp" ./centreon -u admin -p password -o STPL -a add -v "modele disque SNMP usr;Disk_SNMP_usr;modele disque SNMP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele disque SNMP usr;DISK;/usr" ./centreon -u admin -p password -o STPL -a add -v "modele disque SNMP home;Disk_SNMP_home;modele disque SNMP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele disque SNMP home;DISK;/home" ./centreon -u admin -p password -o STPL -a setmacro -v "modele disque SNMP home;WARNING;90" ./centreon -u admin -p password -o STPL -a setmacro -v "modele disque SNMP home;CRITICAL;95"
6.7d Création du modèle CPU SNMP
./centreon -u admin -p password -o STPL -a add -v "modele cpu snmp;CPU_snmp;service-generique-actif" ./centreon -u admin -p password -o STPL -a setparam -v "modele cpu snmp;check_command;check_snmp_cpu" ./centreon -u admin -p password -o STPL -a setmacro -v "modele cpu snmp;WARNING;80" ./centreon -u admin -p password -o STPL -a setmacro -v "modele cpu snmp;CRITICAL;90"
![Stacks Image 7542](files/stacks-image-792538f-40x38.png)
Attention, il y a un petit bug dans le template du graphe CPU, la couleur de "gris background color" est erronée. Cela empêche la génération des graphe comme le montre la copie d'écran ci-dessous. Enlevez le chiffre 1 et les graphes s'affichent correctement.
6.7e Création du modèle LOAD SNMP
./centreon -u admin -p password -o STPL -a add -v "modele load snmp;LOAD_snmp;service-generique-actif" ./centreon -u admin -p password -o STPL -a setparam -v "modele load snmp;check_command;check_snmp_load" ./centreon -u admin -p password -o STPL -a setmacro -v "modele load snmp;WARNING;4,3,2" ./centreon -u admin -p password -o STPL -a setmacro -v "modele load snmp;CRITICAL;6,5,4"
6.7f Création des modèles Traffic
./centreon -u admin -p password -o STPL -a add -v "modele Traffic;Traffic;service-generique-actif" ./centreon -u admin -p password -o STPL -a setparam -v "modele Traffic;check_command;check_traffic" ./centreon -u admin -p password -o STPL -a setmacro -v "modele Traffic;WARNING;80" ./centreon -u admin -p password -o STPL -a setmacro -v "modele Traffic;CRITICAL;90" ./centreon -u admin -p password -o STPL -a add -v "modele Traffic eth0;Traffic eth0;modele Traffic" ./centreon -u admin -p password -o STPL -a setmacro -v "modele Traffic eth0;INTERFACE;eth0"
6.7g Association des modèles de service au modèle OS-Linux-Debian7
./centreon -u admin -p password -o STPL -a addhost -v "modele Traffic eth0;OS-Linux-Debian7" ./centreon -u admin -p password -o STPL -a addhost -v "modele disque SNMP boot;OS-Linux-Debian7" ./centreon -u admin -p password -o STPL -a addhost -v "modele disque SNMP home;OS-Linux-Debian7" ./centreon -u admin -p password -o STPL -a addhost -v "modele disque SNMP root;OS-Linux-Debian7" ./centreon -u admin -p password -o STPL -a addhost -v "modele disque SNMP tmp;OS-Linux-Debian7" ./centreon -u admin -p password -o STPL -a addhost -v "modele disque SNMP usr;OS-Linux-Debian7" ./centreon -u admin -p password -o STPL -a addhost -v "modele disque SNMP var;OS-Linux-Debian7" ./centreon -u admin -p password -o STPL -a addhost -v "modele cpu snmp;OS-Linux-Debian7" ./centreon -u admin -p password -o STPL -a addhost -v "modele load snmp;OS-Linux-Debian7"
6.7h Création des modèles TCP
./centreon -u admin -p password -o STPL -a add -v "modele TCP;TCP;service-generique-actif" ./centreon -u admin -p password -o STPL -a setparam -v "modele TCP;check_command;check_tcp" ./centreon -u admin -p password -o STPL -a setmacro -v "modele TCP;WARNING;0,5" ./centreon -u admin -p password -o STPL -a setmacro -v "modele TCP;CRITICAL;1" ./centreon -u admin -p password -o STPL -a add -v "modele TCP apache 80;TCP Apache 80;modele TCP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele TCP apache 80;PORT;80" ./centreon -u admin -p password -o STPL -a add -v "modele TCP MYSQL;TCP MYSQL;modele TCP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele TCP MYSQL;PORT;3306" ./centreon -u admin -p password -o STPL -a add -v "modele TCP DNS;TCP DNS;modele TCP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele TCP DNS;PORT;53" ./centreon -u admin -p password -o STPL -a add -v "modele TCP LDAP;TCP LDAP;modele TCP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele TCP LDAP;PORT;389" ./centreon -u admin -p password -o STPL -a add -v "modele TCP SMTP;TCP SMTP;modele TCP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele TCP SMTP;PORT;25" ./centreon -u admin -p password -o STPL -a add -v "modele TCP POP3;TCP POP3;modele TCP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele TCP POP3;PORT;110" ./centreon -u admin -p password -o STPL -a add -v "modele TCP IMAP;TCP IMAP;modele TCP" ./centreon -u admin -p password -o STPL -a setmacro -v "modele TCP IMAP;PORT;143"
![Stacks Image 7619](files/stacks-image-792538f-40x38.png)
Attention, en fonction de la valeur du jeu de paramètre régionaux défini par la variable d'environnement LANG, nous devrons définir la bonne valeur pour la macro personnalisée Warning. En effet, nous indiquons une valeur non entière (avec une virgule). Si nous ne tenons pas compte des paramètres régionaux, nous pourrions avoir ce type d'écran.
![bug_tcp_lang](files/bug_tcp_lang.png)
En fait, nous avons saisi 0.5 pour WARNING et la variable d'environnement LANG est égal à fr_FR.UTF-8. Il faut mettre la virgule comme séparateur décimal, pour un serveur en langue US il n'y aura aucun souci.
6.7i Création des modèles Process
./centreon -u admin -p password -o STPL -a add -v "modele Process SNMP;Process SNMP;service-generique-actif"
./centreon -u admin -p password -o STPL -a setparam -v "modele Process SNMP;check_command;check_snmp_process"
./centreon -u admin -p password -o STPL -a add -v "modele Process SNMP multiple;Process SNMP multiple;service-generique-actif"
./centreon -u admin -p password -o STPL -a setparam -v "modele Process SNMP multiple;check_command;check_snmp_process_multiple"
./centreon -u admin -p password -o STPL -a setmacro -v "modele Process SNMP multiple;WARNING;1"
./centreon -u admin -p password -o STPL -a setmacro -v "modele Process SNMP multiple;CRITICAL;2"
./centreon -u admin -p password -o STPL -a add -v "modele Process DNS;Process DNS;modele Process SNMP"
./centreon -u admin -p password -o STPL -a setmacro -v "modele Process DNS;PROCESS;named"
./centreon -u admin -p password -o STPL -a add -v "modele Process MYSQL;Process MYSQL;modele Process SNMP"
./centreon -u admin -p password -o STPL -a setmacro -v "modele Process MYSQL;PROCESS;mysqld"
./centreon -u admin -p password -o STPL -a add -v "modele Process Apache2;Process Apache2;modele Process SNMP"
./centreon -u admin -p password -o STPL -a setmacro -v "modele Process Apache2;PROCESS;apache2 -r"
6.7j Création des modèles applicatifs
./centreon -u admin -p password -o STPL -a addhost -v "modele Process DNS;Linux-DNS" ./centreon -u admin -p password -o STPL -a addhost -v "modele TCP DNS;Linux-DNS" ./centreon -u admin -p password -o STPL -a addhost -v "modele Process MYSQL;Linux-MySQL" ./centreon -u admin -p password -o STPL -a addhost -v "modele TCP MYSQL;Linux-MySQL" ./centreon -u admin -p password -o STPL -a addhost -v "modele Process Apache2;Linux-WEB" ./centreon -u admin -p password -o STPL -a addhost -v "modele TCP apache 80;Linux-WEB" ./centreon -u admin -p password -o STPL -a addhost -v "modele TCP LDAP;Linux-LDAP" ./centreon -u admin -p password -o STPL -a addhost -v "modele TCP SMTP;Linux-MAIL" ./centreon -u admin -p password -o STPL -a addhost -v "modele TCP POP3;Linux-MAIL" ./centreon -u admin -p password -o STPL -a addhost -v "modele TCP IMAP;Linux-MAIL"
6.8 Création des hôtes
./centreon -u admin -p password -o HOST -a add -v "server3;serveur DNS-LDAP-MAIL;172.16.209.52;notification-24x7;Central;Linux-Servers" ./centreon -u admin -p password -o HOST -a setparam -v "server3;host_snmp_community;public" ./centreon -u admin -p password -o HOST -a setparam -v "server3;host_snmp_version;2c" ./centreon -u admin -p password -o HOST -a addtemplate -v "server3;generic-host|OS-Linux-Debian7|Linux-DNS|Linux-LDAP|Linux-MAIL" ./centreon -u admin -p password -o HOST -a add -v "weblamp;serveur WEB;172.16.209.51;notification-24x7;Central;Linux-Servers" ./centreon -u admin -p password -o HOST -a setparam -v "weblamp;host_snmp_community;public" ./centreon -u admin -p password -o HOST -a setparam -v "weblamp;host_snmp_version;2c" ./centreon -u admin -p password -o HOST -a addtemplate -v "weblamp;generic-host|OS-Linux-Debian7|Linux-WEB|Linux-MySQL" ./centreon -u admin -p password -o HOST -a add -v "supervision;serveur Centreon;172.16.209.50;notification-24x7;Central;Linux-Servers" ./centreon -u admin -p password -o HOST -a setparam -v "supervision;host_snmp_community;public" ./centreon -u admin -p password -o HOST -a setparam -v "supervision;host_snmp_version;2c" ./centreon -u admin -p password -o HOST -a addtemplate -v "supervision;generic-host|OS-Linux-Debian7|Linux-WEB|Linux-MySQL »
![Stacks Image 7680](files/stacks-image-792538f-40x38.png)
Attention, mettre le template des notifications en tête des templates à appliquer. Sinon vous risquez d'avoir aucune notification lorsque l'hôte est down. Voir l'article des notifications. Vous devriez avoir cette copie d'écran ci-dessous.
![hote_centreon](files/hote_centreon.png)
./centreon -u admin -p password -o HOST -a applytpl -v "server3" ./centreon -u admin -p password -o HOST -a applytpl -v "weblamp" ./centreon -u admin -p password -o HOST -a applytpl -v "supervision"
6.9 Application de la configuration
./centreon -u admin -p password -a POLLERLIST 1 Central Return code end : 0
Génération de la configuration.
./centreon -u admin -p password -a POLLERGENERATE -v 1 Configuration files generated for poller 1 Return code end : 0
./centreon -u admin -p password -a CFGMOVE -v 1 OK: All configuration files copied with success. Return code end : 0
./centreon -u admin -p password -a POLLERRESTART -v 1 .centengine restart: done.Return code end : 0
![Stacks Image 7717](files/stacks-image-de21bf7-800x524.png)
![Stacks Image 7738](files/stacks-image-1d02928-800x472.png)
service cbd reload
![Stacks Image 7775](files/stacks-image-4df91d5-800x204.png)
7 Gestion des traps Centreon
7.1 Création du service passif
./centreon -u admin -p password -o STPL -a add -v "service-generique-passif;service-generique-passif;" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;check_period;24x7" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;check_command;check_centreon_dummy" ./centreon -u admin -p password -o STPL -a setparam -v 'service-generique-passif;check_command_arguments;!0!OK' ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;max_check_attempts;1" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;normal_check_interval;1" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;retry_check_interval;1" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;active_checks_enabled;0" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;passive_checks_enabled;1" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;notifications_enabled;1" ./centreon -u admin -p password -o STPL -a addcontactgroup -v "service-generique-passif;Supervisors" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;notification_interval;0" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;notification_period;24x7" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;notification_options;w,c,r,f,s" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;first_notification_delay;0" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;service_check_freshness;1" ./centreon -u admin -p password -o STPL -a setparam -v "service-generique-passif;service_freshness_threshold;300"
7.2 Création du template
./centreon -u admin -p password -o STPL -a add -v "Modele_Trap_Linux;TRAP_LINUX;service-generique-passif" ./centreon -u admin -p password -o STPL -a addhost -v "Modele_Trap_Linux;OS-Linux-Debian7" ./centreon -u admin -p password -o STPL -a addtrap -v "Modele_Trap_Linux;linkDown" ./centreon -u admin -p password -o STPL -a addtrap -v "Modele_Trap_Linux;linkUp" ./centreon -u admin -p password -o STPL -a addtrap -v "Modele_Trap_Linux;warmStart" ./centreon -u admin -p password -o STPL -a addtrap -v "Modele_Trap_Linux;coldStart"
7.3 Application du template
./centreon -u admin -p password -o HOST -a applytpl -v "server3" ./centreon -u admin -p password -o HOST -a applytpl -v "weblamp" ./centreon -u admin -p password -o HOST -a applytpl -v "supervision"
./centreon -u admin -p password -a SENDTRAPCFG -v "1" Using HTML::Entities Generating SNMPTT configuration files... 4 traps for 1 manufacturers are defined. SNMPTT configuration files generated. Return code end : 0