Centreon
Sommaire
Centreon
Les valeurs par défaut des ACKNOWLEDGE dans les widgets
Il est possible de cocher des cases par défaut (sticky, notify...) en éditant le fichier suivant:
/usr/share/centreon/www/widgets/service-monitoring/src/acknowledge.ihtml La différence est l'ajout du mot "checked".
Vérification config
/usr/sbin/centengine -v /etc/centreon-engine/centengine.cfg
RRDTools
Check fichier rrdfile: rrdtool "nom du fichier .rrd"
log : tailf /var/log/centreon-broker/central-master-rrd.log
Taille des fichiers de rétention des Graphiques Configuration => Centreon => configuration => Output Maximum size of file : 104857600
Check interface LAN windows
Permet de lister vos interfaces Windows
/usr/lib64/nagios/plugins/centreon_plugins.pl --plugin=os::windows::snmp::plugin --hostname=X.X.X.X --snmp-version='2c' --snmp-community='XXX' --mode list-interfaces
Vous pourrez ensuite superviser les interfaces via leur ID ou leur nom.
Voici par exemple comment remonter le trafic d'une interface en utilisant son nom:
/usr/lib64/nagios/plugins/centreon_plugins.pl --plugin=os::windows::snmp::plugin --hostname=X.X.X.X --snmp-version='2c' --snmp-community='XXX' --mode interfaces --name --interface 'ethernet_7' --add-traffic
Vous pouvez remonter le traffic toutes les interfaces avec une seule et même en commande en ne spécifiant ni l'ID ni le nom. Vous pouvez également utiliser des regexp dans le nom pour en remonter plusieurs:
/usr/lib64/nagios/plugins/centreon_plugins.pl --plugin=os::windows::snmp::plugin --hostname=X.X.X.X --snmp-version='2c' --snmp-community='XXX' --mode interfaces --name --interface 'ethernet_*' --add-traffic
Changer le owner des vue custum
use centreon; UPDATE custom_view_user_relation SET user_id=19 WHERE user_id=1;
Problème lié à des métriques erronées
Certains services étaient associés a des métriques incohérentes (métrique de cpu associé à un contrôle de disque, ou une métrique nommée à l'aide d'une apostrophe). Ces métriques ne contient également aucune données. Toutes ces incohérences étaient la source du dysfonctionnement des graphiques.
Voici la méthode utilisée pour résoudre le problème :
Se connecter au serveur MySQL et lister les métriques du service posant problème : Pour un host mysql> select metric_id, metric_name from index_data i, metrics m where i.host_name = 'FRCCEISSUP01' and i.service_description = 'DISK-Usage' and i.id = m.index_id; Pour tout les host mysql>select i.host_name, metric_id, metric_name from index_data i, metrics m where i.service_description = 'DISK-Usage' and i.id = m.index_id and metric_name like '\; *************************** 1. row *************************** metric_id: 35987 metric_name: /var/lib/centreon *************************** 2. row *************************** metric_id: 35986 metric_name: /var/lib/mysql *************************** 3. row *************************** metric_id: 29686 metric_name: / *************************** 4. row *************************** metric_id: 29687 metric_name: /boot *************************** 5. row *************************** metric_id: 29688 metric_name: /dev/shm *************************** 6. row *************************** metric_id: 38748 metric_name: ' 6 rows in set (0.00 sec)
Pour chaque métrique, vérifier que chacune contient des données à l'aide de la requête suivante (où ID METRIC correspond au champs metric_id précédent) :
mysql> SELECT max(ctime) FROM data_bin WHERE id_metric = 'ID METRIC' ;
Si le requête ne renvoie aucune donnée, ou si la métrique se nomme basiquement 'apostrophe", la supprimer comme ci-dessous :
mysql> update metrics set to_delete = '1' where metric_id = 'ID METRIC' ; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0
Ensuite redémarrer le service cbd pour prendre en compte la suppression.
# /etc/init.d/cbd restart Stopping cbd_central-rrd: [ OK ] Stopping cbd_central-broker: [ OK ] Starting cbd_central-rrd: [ OK ] Starting cbd_central-broker: [ OK ]
Trouver un graphe erreur Centreon.
Retourne ID service (collone ID)
select * from centreon_storage.index_data where host_name like 'FRCCEISSUP04';
Retourne les lignes du service (si ' supprimer la ligne) (ID = index_id)
Select * from centreon_storage.metrics where index_id like '4530';
Requette graphe disk KO
Affiche toutes les entrées avec une ' dans le nom
select * from centreon_storage.metrics where metric_name = "'";
Clapi
Liste des objets et actions Centreon-Clapi v 1.3.1
| Objet | Désignation | Désignation |
|---|---|---|
| English | Français | |
| ACL | Access List | Liste d'accès |
| ACLACTION | Actions Access | Gestion des accès sur les actions |
| ACLGROUP | Access Groups | Gestion des groupe d'accès |
| ACLMENU | Menus Access | Gestion des accès aux menus |
| ACLRESOURCE | Ressources Access | Gestion des accès aux ressources |
| CG | Contact Groups | Groupes de contacts |
| CGICFG | cgi Nagios | cgi Nagios |
| CMD | Commands | Commandes |
| CONTACT | Contacts / Users | Contacts / Utilisateurs |
| CONTACTTPL | Contact Template | Modèles de contact |
| HC | Hosts Catégories | Catégories d'hôtes |
| HG | Hosts Groups | Groupes d'hôtes |
| HOST | Hosts | Hôtes |
| HTPL | Hosts Template | Modèle d'hôtes |
| INSTANCE | Poller | Collecteur |
| LDAP | Ldap | Ldap |
| NAGIOSCFG | nagios.cfg Nagios | nagios.cfg Nagios |
| NDO2DBCFG | ndo2db.cfg NDOutils | ndo2db.cfg NDOutils |
| NDOMODCFG | ndomod.cfg NDOutils | ndomod.cfg NDOutils |
| RESOURCECFG | Resources Nagios | Ressources Nagios |
| SC | Services Catégories | Catégories de services |
| SERVICE | Services | Services |
| SG | Services Groups | Groupes de services |
| STPL | Services Template | Modèle de services |
| TIMEPERIOD | Time periods | Périodes temporelles |
| ACTION | OBJET SUPERVISEUR |
|---|---|
| ADD | ACLACTION, ACLGROUP, ACLMENU, ACLRESOURCE, CGICFG, CMD, CONTACT, CONTACTTPL, CG, HTPL, HOST, HG, HC, INSTANCE, LDAP, NAGIOSCFG,NDO2DBCFG, NDOMODCFG, RESOURCECFG, STPL, SERVICE, SG, SC, TIMEPERIOD |
| ADDCONTACT | CG, HTPL, HOST, STPL, SERVICE |
| ADDCONTACTGROUP | ACLGROUP, HTPL, HOST, STPL, SERVICE |
| ADDHOST | STPL |
| ADDHOSTGROUP | HTPL, HOST |
| ADDMEMBER | HG, HC |
| ADDPARENT | HTPL, HOST |
| ADDRESOURCE | ACLGROUP |
| ADDSERVICE | SG, SC |
| ADDSERVICETEMPLATE | SC |
| ADDTEMPLATE | HTPL, HOST |
| APPLYTPL | HOST |
| CFGMOVE | |
| DEL | ACLACTION, ACLGROUP, ACLMENU, ACLRESOURCE, CGICFG, CMD, CONTACT, CONTACTTPL, CG, HTPL, HOST, HG, HC, INSTANCE, LDAP, NAGIOSCFG, NDO2DBCFG, NDOMODCFG, RESOURCECFG, STPL, SERVICE, SG, SC, TIMEPERIOD |
| DELACTION | ACLGROUP |
| DELCONTACT | ACLGROUP, CG, HTPL, HOST, STPL, SERVICE |
| DELCONTACTGROUP | HTPL, HOST, STPL, SERVICE |
| DELEXCEPTION | TIMEPERIOD |
| DELHOST | STPL, SERVICE |
| DELHOSTGROUP | HTPL, HOST |
| DELHOSTGROUPSERVICE | SG |
| DELMACRO | HTPL, HOST, STPL, SERVICE |
| DELMEMBER | HG, HC |
| DELPARENT | HTPL, HOST |
| DELSERVICE | SG, SC |
| DELSERVICETEMPLATE | SC |
| DELTEMPLATE | HTPL, HOST |
| DISABLE | CONTACT, CONTACTTPL, CG, HTPL, HOST |
| ENABLE | CONTACT, CONTACTTPL, CG, HTPL, HOST |
| GETACTION | ACLGROUP |
| GETACLGROUP | ACLACTION, ACLMENU, ACLRESOURCE, CONTACT, CONTACTTPL |
| GETCONTACT | ACLGROUP, CG, HTPL, HOST, STPL, SERVICE |
| GETCONTACTGROUP | ACLGROUP, HTPL, HOST, STPL, SERVICE |
| GETEXCEPTION | TIMEPERIOD |
| GETHOSTGROUP | HTPL, HOST |
| GETHOSTGROUPSERVICE | SG |
| GETMACRO | HTPL, HOST, STPL, SERVICE |
| GETMEMBER | HG, HC |
| GETMENU | ACLGROUP |
| GETPARENT | HTPL, HOST |
| GETRESOURCE | ACLGROUP |
| GETSERVICE | SG, SC |
| GETSERVICETEMPLATE | SC |
| GETTEMPLATE | HTPL, HOST |
| GRANT | ACLACTION, ACLMENU |
| LASTRELOAD | ACL |
| POLLERGENERATE | |
| POLLERLIST | |
| POLLERRELOAD | |
| POLLERESTART | |
| POLLERTEST | |
| RELOAD ACL | |
| REVOKE | ACLACTION, ACLMENU |
| SETCONTACT | ACLGROUP, CG, HTPL, HOST, STPL, SERVICE |
| SETCONTACTGROUP | HTPL, HOST, STPL, SERVICE |
| SETCONTACTTEMPLATE | LDAP |
| SETEXCEPTION | TIMEPERIOD |
| SETHOST | STPL, SERVICE |
| SETHOSTGROUP | HTPL, HOST |
| SETHOSTGROUPSERVICE | SG |
| SETINSTANCE | HTPL, HOST |
| SETMACRO | HTPL, HOST, STPL, SERVICE |
| SETMEMBER | HG, HC |
| SETMENU | ACLGROUP |
| SETPARAM | ACLACTION, ACLGROUP, ACLMENU, ACLRESOURCE, CGICFG, CMD, CONTACT, CONTACTTPL, CG, HTPL, HOST, HG, INSTANCE, LDAP, NAGIOSCFG, NDO2DBCFG, NDOMODCFG, RESOURCECFG, STPL, SERVICE, SG, SC, TIMEPERIOD |
| SETPARENT | HTPL, HOST |
| SETSERVICE | SG |
| SETTEMPLATE | HTPL, HOST |
| SHOW | ACLACTION, ACLGROUP, ACLMENU, ACLRESOURCE, CGICFG, CMD, CONTACT, CONTACTTPL, CG, HTPL, HOST, HG, HC, INSTANCE, LDAP, NAGIOSCFG, NDO2DBCFG, NDOMODCFG, RESOURCECFG, STPL, SERVICE, SG, SC, TIMEPERIOD |
| UNSETACLGROUP | CONTACT, CONTACTTPL |
BAM
ClapiBAM
Ajout KPI
centreon -u admin -p BZeGqxtGarc -o KPI -a ADD -v 'service;FRCCESGAPA01|CPU;IBM_Cognos_TM1;Weak;Minor;Major'
Trucs
Redimensionnement des Services name en configuration.
Modifier la ligne 65 du fichier : /usr/share/centreon/www/include/configuration/configObject/service/listService.ihtml
en
Mysql recheche des status
SELECT hostgroups.hostgroup_id, hostgroups.name AS HostGroup, hosts.host_id, hosts.name AS Hosts, hosts.state, services.description AS Services, services.state
FROM hostgroups, hosts_hostgroups, hosts, services
WHERE hostgroups.hostgroup_id = hosts_hostgroups.hostgroup_id
AND hosts_hostgroups.host_id = hosts.host_id
AND services.host_id = hosts.host_id
AND hosts.enabled='1'
AND services.enabled='1'
AND hostgroups.name = 'hg-sextant'
AND hosts.state in ('2','3')
OR hostgroups.hostgroup_id = hosts_hostgroups.hostgroup_id
AND hosts_hostgroups.host_id = hosts.host_id
AND services.host_id = hosts.host_id
AND hosts.enabled='1'
AND services.enabled='1'
AND hostgroups.name = 'hg-sextant'
AND services.state in ('2','3');