Nagios Conference 2012 - Jason Cook - Nagios and Mod-Gearman
Nagios Installation Guide
-
Upload
caasoluciones -
Category
Documents
-
view
16 -
download
2
description
Transcript of Nagios Installation Guide
-
GiuseppeTurri Email:[email protected]
Pagina 1 di 3
HOW TO Install Nagios Core on RedHat Enterprise Linux Systems...... Without Problems :-)
1- Install system software needed by nagios installation Webegininstallingandverifyingthepackagerequirementsandso,asrootuser,submitthefollowingcommand: yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp
2- Download Nagios core and main plugin WhenI'mwritingthisdocumentthelatestavailableversionofnagioscoreisthe3.4.1andyoucandownloaditbrowsingattheurlhttp://prdownloads.sourceforge.net/sourceforge/nagios/nagios3.4.1.tar.gzordirectlybywgetwiththiscommand: cd /tmp wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.1.tar.gz wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz Note:ifyoursystemisbehindaproxyserveryoumayneedtoconfiguretheproxytoallowtheinternetconnectiontowgetfollowingthesesteps
addyourproxyto/erc/wgetrcconfigurationfile(uncommentandmodifythetypeofproxyusedinyournetwork) uncommenttheuse_proxy=onsettingor,ifyoudon'twanttousetheproxyatallyoumayturnoffthissettingandissue
thewgetcommandfollowebbyproxy=onproxyuser=userproxypassword=passwordandthentheurl(examplewgetproxy=onproxyuser=userproxypassword=passwordhttp://www.xxx.zzz)
3- Installing Nagios core & main plugin OnceDownloadedthetarfilewehavetocreatetheuserandgroupfornagiosandsosubmitthesecommands:
useradd nagios groupadd nagcmd usermod -a -G nagcmd nagios
Nowwecanextractthesoftwarefromthetarball tar zxf nagios-3.4.1.tar.gz tar zxf nagios-plugins-1.4.15.tar.gz
-
GiuseppeTurri Email:[email protected]
Pagina 2 di 3
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
Nowwehavetocreateanusertoaccesstothenagioswebinterfacesowecreateanusernamednagiosadmindefiningapasswordforit: htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin Atthispointthenagioscoreisinstalled,upandrunning.Youcanaccesstoyournagiosinstallationbybrowsingtheurlhttp://yourservername/nagiosYou'llbepromptabasicauthenticationwhereyouhavetousethenagiosadminaccountcreatedwiththelatestcommandsubmitted.Everytimeyoumodifyanagiosconfigurationfileyoumayverifytheconfigurationbythecommand
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg and,ifallisok,youcanrestartthenagiosservicetoexecutethemodifiedcode.Thenextchapteroftheguideisforhelpingyouincaseofproblems.ToverifyifyourinstallationisfreeofproblemsandtocheckthestatusofyourinstallationIsuggestyouto:
Tryanaccessthroughthewebinterface Trytoaccesstotheservicessectionandtrytorescheduleachecknow Trytoverifythemailnotification(changetheemailaddressinthe
/usr/local/nagios/etc/objects/contacts.cfgconfigurationfile).
-
GiuseppeTurri Email:[email protected]
Pagina 3 di 3
4- MOST COMMON PROBLEMS RESOLUTION Error403Forbiddenyoudon'thavepermissiontoaccess/nagios/onthisserver.
whenyoutrytoaccessthenagioswebinterfaceChecktheinstallationofthephpsoftwareonyoursystemyum 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/oryouareabletosendemailnotificationbycommandline
I'vespentalotoftimewhitthiskindofproblem.... Socheckifyouareabletosendemailbyterminallineasrootuserwiththiscommand:
/usr/bin/printf "Notification Test" | /bin/mail -s "This is a test" your-email@address
Ifyoucanexecutethecommandandyoureceivetheemailnowwecantrytosubmitthesame commandasnagiosusersoexecute:
su - nagios /usr/bin/printf "Notification Test" | /bin/mail -s "This is a test" your-
email@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
Go to NAGIOS website http://www.nagios.com/#ref=s57X3l