Koozali.org: home of the SME Server

Other Languages => Italiano => Topic started by: MicSme on July 02, 2013, 05:15:19 PM

Title: Sme 8 nagios
Post by: MicSme on July 02, 2013, 05:15:19 PM
Ciao a tutti,
Ho installato nagios seguendo questa guida http://wiki.contribs.org/Nagios
quando testo la configurazione con:
nagios -v /etc/nagios/nagios.cfg il risultato sembra confortante...
->>
Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/etc/nagios/objects/commands.cfg'...
Processing object config file '/etc/nagios/objects/contacts.cfg'...
Processing object config file '/etc/nagios/objects/timeperiods.cfg'...
Processing object config file '/etc/nagios/objects/templates.cfg'...
Processing object config file '/etc/nagios/objects/localhost.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
        Checked 8 services.
Checking hosts...
        Checked 1 hosts.
Checking host groups...
        Checked 1 host groups.
Checking service groups...
        Checked 0 service groups.
Checking contacts...
        Checked 1 contacts.
Checking contact groups...
        Checked 1 contact groups.
Checking service escalations...
        Checked 0 service escalations.
Checking service dependencies...
        Checked 0 service dependencies.
Checking host escalations...
        Checked 0 host escalations.
Checking host dependencies...
        Checked 0 host dependencies.
Checking commands...
        Checked 24 commands.
Checking time periods...
        Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
-->>

Poi tentando di avviare il servizio ..
service nagios start
il risultato e' sconfortante:
'nagios' is not a valid service name
eppure se faccio
config show nagios mi dice..
nagios=service
    Name=Nagios
    PublicAccess=global-pw
Premetto che in fase di installazione ho avuto errori con i pid di yum (incomprensibili  almeno per me'...)

Qualcuno e' riuscito nell'impresa?

Michele
Title: Re: Sme 8 nagios
Post by: Stefano on July 02, 2013, 07:39:09 PM
posta il risultato di
Code: [Select]
ls -la /etc/rc7.d/*nagios*
ls -la /etc/rc.d/init.d/*nagios*
Title: Re: Sme 8 nagios
Post by: MicSme on July 02, 2013, 08:41:09 PM
ecco qua'!
[root@smesrv packages]# ls -la /etc/rc7.d/*nagios*
ls: /etc/rc7.d/*nagios*: No such file or directory
[root@smesrv packages]# ls -la /etc/rc.d/init.d/*nagios*
-rwxr-xr-x 1 root root 2416 26 nov  2010 /etc/rc.d/init.d/nagios
Title: Re: Sme 8 nagios
Post by: Stefano on July 02, 2013, 08:45:03 PM
Code: [Select]
cd /etc/rc7.d
ln -s /etc/rc.d/init.d/e-smith-service S99nagios
service nagios start
Title: Re: Sme 8 nagios
Post by: MicSme on July 02, 2013, 09:04:21 PM
[root@smesrv rc7.d]# service nagios start
[root@smesrv rc7.d]# service nagios restart
Interruzione di nagios:                                    [FALLITO]
Avvio di nagios:                                           [  OK  ]

se digito https://smesrv/nagios mi dice pagina nn trovata...
Title: Re: Sme 8 nagios
Post by: Stefano on July 02, 2013, 09:33:18 PM
mi si รจ rotta la sfera di cristallo
cosa dicono i log?
Title: Re: Sme 8 nagios
Post by: MicSme on July 02, 2013, 09:54:10 PM
Jul  2 21:53:18 smesrv nagios: Nagios 3.2.3 starting... (PID=4150)
Jul  2 21:53:19 smesrv nagios: Local time is Tue Jul 02 21:53:19 CEST 2013
Jul  2 21:53:19 smesrv nagios: LOG VERSION: 2.0
Jul  2 21:53:19 smesrv nagios: Finished daemonizing... (New PID=4151)

sembrerebbe tutto ok solo che mi son persa l'interfaccia web...
Title: Re: Sme 8 nagios
Post by: MicSme on July 02, 2013, 10:20:52 PM
Il servizio funziona.
sono andato in
cd ./usr/share/nagios/
ed ho sostituito l'index.php con una paginetta html del piffero
mi da sempre pagina nn trovata.
mi sa che e' un errore o un eccezione nn gestita in apache
... :?
Title: Re: Sme 8 nagios
Post by: Stefano on July 02, 2013, 10:46:37 PM
e i log di apache?

posta anche il risultato di
Code: [Select]
/sbin/e-smith/audittools/templates | grep -i nagios
Title: Re: Sme 8 nagios
Post by: MicSme on July 02, 2013, 10:50:10 PM
niente
[root@smesrv ~]# /sbin/e-smith/audittools/templates | grep -i nagios
[root@smesrv ~]#
e neanche in httpd.conf trovo nagios
e' una misconfigurazione di apache..?
Title: Re: Sme 8 nagios
Post by: Stefano on July 02, 2013, 10:53:34 PM
Code: [Select]
rpm -qa | grep nagios
Title: Re: Sme 8 nagios
Post by: MicSme on July 02, 2013, 10:56:11 PM
[root@smesrv nagios]# rpm -qa | grep nagios
nagios-plugins-1.4.16-1.el5.rf
nagios-of-plugins-0.9.4-1.of
nagios-plugins-setuid-1.4.16-1.el5.rf
nagios-3.2.3-3.el5.rf
nagios-plugins-generic-1.0.0-0.el4.rf
nagios-plugins-esx3i-1.0.3-0.el4
nagios-plugins-temptrax-2.0.1-1.el4.rf

-----

e questo log?

[Tue Jul 02 22:41:03 2013] [error] [client 192.168.1.65] File does not exist: /home/e-smith/files/ibays/Primary/html/nagios
[Tue Jul 02 22:46:35 2013] [error] [client 192.168.1.65] File does not exist: /home/e-smith/files/ibays/Primary/html/nagios
[Tue Jul 02 22:46:43 2013] [error] [client 192.168.1.65] File does not exist: /home/e-smith/files/ibays/Primary/html/nagios

me lo cerca qui invece che in usr/share/nagios????

Title: Re: Sme 8 nagios
Post by: Stefano on July 02, 2013, 11:01:48 PM
tra i file che hai scaricato dovresti avere anche un smeserver-nagios

Code: [Select]
yum localinstall smeserver-nagios (occhio completare bene qui il percorso)
Title: Re: Sme 8 nagios
Post by: MicSme on July 02, 2013, 11:03:04 PM
all.md5sum           nagios-central-config-sample1.tar.gz
dtree_data.js.patch  nagios-icons-nx-1.0.0.tar.gz
index.html           nagios-nuvola-1.0.3.tar.gz
index.html?C=D;O=A   nagios-of-plugins-0.9.4-1.of.noarch.rpm
index.html?C=D;O=D   nagios-plugins-esx3i-1.0.3-0.el4.noarch.rpm
index.html?C=M;O=A   nagios-plugins-generic-1.0.0-0.el4.rf.noarch.rpm
index.html?C=M;O=D   nagios-plugins-temptrax-2.0.1-1.el4.rf.i386.rpm
index.html?C=N;O=A   nrpe.cfg
index.html?C=N;O=D   perl-Nagios-Plugin-0.17-1.rf.noarch.rpm
index.html?C=S;O=A   wgetall

mi manca smeserver-nagios accidenti!
Title: Re: Sme 8 nagios
Post by: Stefano on July 02, 2013, 11:23:42 PM
hai letto questo dalla pagina del wiki?
Quote
   This contrib does not work on SME8b6 as documented here, there are a few changes needed to the repository info and also the yum commands, also a change needs to be made to the location of the nagios.pid file in order for it run successfully after installation. There is an outstanding bug bugzilla:5539 which contains the necessary information.

e il bug in esso linkato?
Title: Re: Sme 8 nagios
Post by: MicSme on July 03, 2013, 05:07:19 PM
Si ho letto attentamente ed ho anche tentato
Quote
/sbin/e-smith/db yum_repositories set dag repository \
Name 'Dag - EL5' \
BaseURL 'http://apt.sw.be/redhat/el5/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled

rm -f /var/cache/yum/*

/usr/bin/yum --enablerepo=dag localinstall \
 smeserver-nagios-*.noarch.rpm \
 pnp-*.i386.rpm \
 smeserver-nagios-backup-*.noarch.rpm \
 perl-Nagios-Plugin-*.noarch.rpm \
 smeserver-nagios-plugins-mysql-*.noarch.rpm \
 nagios-plugins-generic-*.noarch.rpm \
 nagios-of-plugins-*.noarch.rpm \
 nagios-plugins-temptrax-*.el5.rf.i386.rpm \
 nagios-plugins-esx3i-*.el5.noarch.rpm

mkdir -p /var/run/nagios
chown nagios:nagios /var/run/nagios

vi /etc/nagios/nagios.cfg

lockfile=/var/run/nagios/nagios.pid

service nagios restart
ma nisba ... aspetto il contrib nel repo di sme 8
in poche parole avrei bisogno di un tool che mi monitorasse un ip pubblico esterno alla lan e che in caso di down dell'ip monitorato mi spedisse una mail per adesso son costretto ad usare emco ping monitor ma aime' su un client xp...preferirei che certi lavori restassero tutti sullo sme server ma non saprei come configurare una cosa del genere.
Grazie cmq di tutto Michele
Title: Re: Sme 8 nagios
Post by: Stefano on July 03, 2013, 05:22:19 PM
allora cerca in rete per "cron ping email monitor script" e dovresti trovare qualcosa
Title: Re: Sme 8 nagios
Post by: MicSme on July 03, 2013, 09:12:01 PM
Facendo seguito al suggerimento di Stefano ho adottato questa soluzione.
Per testare un ip remoto sulla wan ho adattato questo script al quale ho dato il nome di hostping.sh e messo nella root dello sme server :
Quote
#!/bin/bash
HOSTS="indirizzo ip pubblico da monitorare"
COUNT=4
for myHost in $HOSTS
do
count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
if [ $count -eq 0 ]; then
# 100% failed
echo "Connessione fallita il $(date)" | mail -s "connessione Down" mail@miodominio.xx
echo "Host : $myHost non connesso (ping failed) il $(date)"
fi
done
poi l'ho reso eseguibile con
Quote
chmod +x hostping.sh
poi seguendo le indicazioni l'ho schedulato..
Quote
mkdir -p /etc/e-smith/templates-custom/etc/crontab
vi /etc/e-smith/templates-custom/etc/crontab/hostping
# schedulazione di un ping ogni minuto  con cron
01 * * * * root /root/hostping.sh
expand-template /etc/crontab
service crond restart

Un saluto Michele