Les hôtes ne s'affichent pas avec Nagios et le widget host-monitoring

En attendant une prochaine mise à jour, voici les modifications pour résoudre ce problème. Les widgets se trouvent dans le dossier www/widgets de Centreon. Pour une distribution CES, ce sera /usr/share/centreon/www/widgets. les fichiers du widget host-monitoring se trouvent dans le dossier du même nom. Voici l'arborescence ci-dessous, il faudra modifier deux fichiers :
La modification du fichier index_ndo.php permet l'ajout de l'alias. Modifiez la requête comme ci-dessous :
$query = "SELECT SQL_CALC_FOUND_ROWS h.display_name as name,
hs.current_state as state,
hs.state_type,
h.alias,
h.address,
hs.last_hard_state,
hs.output,
hs.scheduled_downtime_depth,
hs.problem_has_been_acknowledged as acknowledged,
h.notifications_enabled as notify,
h.active_checks_enabled as active_checks,
h.passive_checks_enabled as passive_checks,
UNIX_TIMESTAMP(last_check) as last_check,
UNIX_TIMESTAMP(last_state_change) as last_state_change,
UNIX_TIMESTAMP(last_hard_state_change) as last_hard_state_change,
hs.current_check_attempt as check_attempt,
hs.max_check_attempts,
h.action_url,
h.notes_url ";
La modification du fichier index.ihtml permet l'affichage du nom d'hôte en fonction du type de broker (variable broker). Il y a
{$elem.host_name}
il faut
{if $broker == 1}
{$elem.host_name}
{else}
{$elem.name}
{/if}
Une fois les modifications effectuées, vous obtiendrez de nouveau l'affichage des hôtes et alias.
Les templates spéciaux de PNP4NAGIOS

Un exemple concret
Prenons le cas où nous désirons avoir tous les graphes de charge de tous nos serveurs supervisés. Il suffira de copier le fichier load.php ci-dessous dans le dossier /usr/local/pnp4nagios/share/templates.special
?php
#
#
#
$this->MACRO['TITLE'] = "Charge serveur";
$this->MACRO['COMMENT'] = "Pour tous les serveurs";
#
# Define the Service we want to graph
$services = $this->tplGetServices("","Load");
#
# The Datasource Name for Graph 1 ( index 0 )
$ds_name[0] = "LOADAVERAGE";
$opt[0] = "--title \"Charge Serveur\"";
$def[0] = "";
#
# Iterate through the list of hosts
foreach($services as $key=>$val){
#
# get the data for a given Host/Service
$data = $this->tplGetData($val['host'],$val['service']);
$hostname = rrd::cut($data['MACRO']['HOSTNAME']);
$def[0] .= rrd::def("var$key" ,$data['DS'][0]['RRDFILE'], $data['DS'][0]['DS'], "AVERAGE");
$def[0] .= rrd::line1("var$key", rrd::color($key), $hostname);
$def[0] .= rrd::gprint("var$key", array("MAX", "AVERAGE"));
}
?>
Lire plus…
Superviser avec un RaspBerry


Je vous souhaite une bonne année 2014.
Créez vos plugins - deuxième partie


Créez vos plugins de supervision avec Perl

Un plugin pour les cifs NAS EMC
Mise à jour du 05/03, prise en compte des Tree Quota
J'en profite pour vous faire découvrir ma première réalisation en HTML 5 avec ce petit tuto animé, le premier d'une longue série...
Mise à jour du site


Migration Nagios vers Centreon Engine

Publication L'atelier de Kermith sur iTunes
Publication L'atelier de Kermith
En attendant une éventuelle publication sur App Store, si si j'ai osé , je vous propose en téléchargement ma première publication iBook pour Ipad.
Des nouveautés pour la supervision
Centreon 2.1.11 et première configuration

Fail-Over Nagios
Nouveau document au format ePub

Vous avez donc la possibilité de le récupérer pour l’installer sur votre iPhone favori. Bonne lecture !
Upate du document ! version du 30 août 2010 en ligne.
Utilisation d'une sonde AKCP avec Nagios

Installation de Nagios
Amélioration du plugin Quota Tree
Plugin Quotas Tree Celerra
NSCA et Centreon

exemple d'utilisation de NSCA avec CFT