Escolar Documentos
Profissional Documentos
Cultura Documentos
Email:g.turri@giuseppeturri.it
Nowwecanextractthesoftwarefromthetarball
tar zxf nagios-3.4.1.tar.gz
tar zxf nagios-plugins-1.4.15.tar.gz
Pagina 1 di 3
GiuseppeTurri
Email:g.turri@giuseppeturri.it
Andinstallthecorenagiossoftware
cd nagios
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
andthemainplugin
cd ../nagios-plugin*
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
Wecanstartthenagionandhttpdservicesbyissuingthecommand
service httpd start
service nagios start
Terminatedtheinstallationcommandwecansetthesystemtostartupnagiosandhttpdatstartuptime:
chkconfig nagios --level 35 on
chkconfig httpd --level 35 on
Nowwehavetocreateanusertoaccesstothenagioswebinterfacesowecreateanusernamed
nagiosadmindefiningapasswordforit:
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Atthispointthenagioscoreisinstalled,upandrunning.
Youcanaccesstoyournagiosinstallationbybrowsingtheurlhttp://yourservername/nagios
You'llbepromptabasicauthenticationwhereyouhavetousethenagiosadminaccountcreatedwiththelatest
commandsubmitted.
Everytimeyoumodifyanagiosconfigurationfileyoumayverifytheconfigurationbythecommand
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
and,ifallisok,youcanrestartthenagiosservicetoexecutethemodifiedcode.
Thenextchapteroftheguideisforhelpingyouincaseofproblems.Toverifyifyourinstallationisfreeofproblems
andtocheckthestatusofyourinstallationIsuggestyouto:
Tryanaccessthroughthewebinterface
Trytoaccesstotheservicessectionandtrytorescheduleachecknow
Trytoverifythemailnotification(changetheemailaddressinthe
/usr/local/nagios/etc/objects/contacts.cfgconfigurationfile).
Pagina 2 di 3
GiuseppeTurri
Email:g.turri@giuseppeturri.it
Checktheinstallationofthephpsoftwareonyoursystem
yum install php
service httpd restart
Error:Couldnotopencommandfile/var/nagios/rw/nagios.cmdforupdate!
Whenyoutrytorescheduleacheckofaservicebynagioswebinterface
chown nagios.nagcmd /usr/local/nagios/var/rw
chmod g+rwx /usr/local/nagios/var/rw
chmod g+s /usr/local/nagios/var/rw
usermod -G nagcmd apache
service httpd restart
service nagios restart
Youdon'treceiveanyemailnotificationand/oryouareabletosendemail
notificationbycommandline
I'vespentalotoftimewhitthiskindofproblem....
Socheckifyouareabletosendemailbyterminallineasrootuserwiththiscommand:
/usr/bin/printf "Notification Test" | /bin/mail -s "This is a test" youremail@address
Ifyoucanexecutethecommandandyoureceivetheemailnowwecantrytosubmitthesame
commandasnagiosusersoexecute:
su - nagios
/usr/bin/printf "Notification Test" | /bin/mail -s "This is a test" youremail@address
Probablyyou'llgetthiserror
WARNING:RunAsUserforMSPignored,checkgroupids(egid=503,want=51)
cannotchdir(/var/spool/clientmqueue/):Permissiondenied
Programmoderequiresspecialprivileges,e.g.,rootorTrustedUser.
Ifyouhaveasimilarerrormessagewecansolveitbyissuing,asrootuser,thiscommand:
chmod 2755 /usr/sbin/sendmail.sendmail
service sendmail restart
Pagina 3 di 3