Vous êtes sur la page 1sur 4

Step by Step Nagios Installation on SERVER

Instructions for Installing Nagios 2.5 Pre-Requisites: If you are installing Nagios on CentOS, ensure that the following ac!ages are installe" #efore you rocee" for Nagios 2.5 installation: o gcc-$.%.&-'.i'().r * o gcc-c++-$.%.&-'.i'().r * o g"-"e,el-2.&.''-).2.i'().r * o g"-2.&.''-).2.i'().r * o g"#-).'.&.&-%.%22.i'().r * o g"#*-%.(.&-2).2.i'().r * o gette-t-&.%$.5-'.i'().r * o li#gcc-$.%.&-'.i'().r * o li#. eg-)#-').2.%.i'().r * o li#. eg-"e,el-)#-').2.%.i'().r * o li# ng-2:%.2.(-2.2.%.i'().r * o li# ng-"e,el-2:%.2.(-2.2.%.i'().r * o erl-/ate0ani -5.$$-%.2.noarch.r * Installation Proce"ure: %. /ownloa" nagios-2.5.tar.g1 2. /ownloa" nagios- lugins-%.$.'.tar.g1 '. 2oto 3 $. *!"ir 3usr3src3nagios-install 5. *, nagios- lugins-%.$.'.tar.g1 an" nagios-2.5.tar.g1 3usr3src3nagios-install ). 2oto c" 3usr3src3nagios-install 4. Run tar -1f nagios-2.5.tar.g1 (. Run tar -1f nagios- lugins-%.$.'.tar.g1 5. Run usera"" nagios %&. Run grou a"" nagios %%. 2oto 3 %2. *!"ir 3usr3local3nagios %'. *!"ir 3ho*e3nagios %$. Run chown nagios.nagios 3usr3local3nagios %5. 2oto 3 %). Run grou a"" nagc*" %4. 3usr3s#in3user*o" -2 nagc*" a ache %(. 3usr3s#in3user*o" -2 nagc*" nagios %5. 2oto 3usr3src3nagios-install3nagios-2.53 2&. Run .3configure -- refi-63usr3local3nagios --with-cgiurl63nagios3cgi-#in --withht*url63nagios --with-nagios-user6nagios --with-nagios-grou 6nagios --with-co**an"grou 6nagc*" 777Correction *ost of those switches are the "efaults an" are not nee"e". 8his woul" suffice: Run .3configure --with-co**an"-grou 6nagc*"

Note - 8o get Ste 2& to wor!, you will nee" ha,e all the a#o,e re-requisites installe" 2%. Run *a!e all 22. Run *a!e install 2'. Run *a!e install-init 2$. Run *a!e install-co**an"*o"e 25. Run *a!e install-config 2). 2oto 3 24. 2oto 3usr3local3nagios 2(. Run *!"ir li#e-ec Note - the following is for installing the stan"ar" Nagios Plug-Ins 25. 2oto 3 '&. 2oto 3usr3src3nagios-install3nagios- lugins-%.$.'3 '%. Run .3configure -- refi-63usr3local3nagios --with-nagios-user6nagios --with-nagiosgrou 6nagc*" --with-cgiurl63nagios3cgi-#in 77Correction *ost are the "efaults an" are not nee"e" an" this o tion was not correct 9-with-nagios-grou 6nagc*"9 since you co* ile" nagios with the grou na*e" nagios.. 8his woul" suffice: Run .3configure '2. Run *a!e ''. Run *a!e install '$. 2oto 3etc3htt "3conf3 '5. Run ,i* htt ".conf or e"it htt ".conf using te-t e"itor '). Insert the following Scri t:lias 3nagios3cgi-#in3 93usr3local3nagios3s#in39 ;/irectory 93usr3local3nagios3s#in39< O tions =-ecC2I :llowO,erri"e None Or"er allow,"eny :llow fro* all :uthNa*e 9Nagios :ccess9 :uth8y e >asic :uth?ser@ile 3usr3local3nagios3etc3ht assw".users Require ,ali"-user ;3/irectory< :lias 3Nagios3 93usr3local3nagios3share39 ;/irectory 93usr3local3nagios3share39< O tions None :llowO,erri"e None Or"er allow,"eny :llow fro* all :uthNa*e 9Nagios :ccess9 :uth8y e >asic :uth?ser@ile 3usr3local3nagios3etc3ht assw".users Require ,ali"-user

;3/irectory< 777Correction, ste ') a ears to #e all wrong. NO8=: if your 3etc3htt "3conf3htt ".conf file contains this: Inclu"e conf."37.conf then you can a"" the #elow to a file na*e" nagios.conf in the "irectory 3etc3htt "3conf."3 Aou choose, #ut I refer the lea,e the htt ".conf file *ostly ,irgin, an" a"" things in the a#o,e "irectory. 0a!es it nice an" ti"y that way. :"" this to the a ache config Scri t:lias 3nagios3cgi-#in3 3usr3local3nagios3s#in3 ;/irectory 93usr3local3nagios3s#in39< :llowO,erri"e :uthConfig O tions =-ecC2I Or"er allow,"eny :llow fro* all ;3/irectory< :lias 3nagios3 3usr3local3nagios3share3 ;/irectory 93usr3local3nagios3share9< O tions None :llowO,erri"e :uthConfig Or"er allow,"eny :llow fro* all ;3/irectory< Now create a .htaccess file in nagios3share an" nagios3s#in3 which is *issing fro* the 2."ocs. :uthNa*e 9Nagios :ccess9 :uth8y e >asic :uth?ser@ile 3usr3local3nagios3etc3ht assw".users require ,ali"-user '4. 2oto 3 '(. 8o create an authenticate" user run Bht assw" -c 3usr3local3nagios3etc3ht assw".users nagiosa"*in '5. =nter the asswor" of choice $&. 2oto 3usr3local3nagios3etc $%. Run *, cgi.cfg-sa* le cgi.cfg $2. Run ,i* cgi.cfg or e"it using te-t e"itor $'. Change an un-co**ent the following lines: authori1e"CforCsyste*Cinfor*ation6nagiosa"*in authori1e"CforCsyste*Cco**an"s6nagiosa"*in authori1e"CforCconfigurationCinfor*ation6nagiosa"*in authori1e"CforCallChosts6nagiosa"*in authori1e"CforCallChostCser,ices6nagiosa"*in authori1e"CforCallCser,ices6nagiosa"*in authori1e"CforCallCser,iceCco**an"s6nagiosa"*in $$. Restart : ache B3etc3rc."3init."3htt " restartB

$5. 2oto 3usr3local3nagios3etc $). Run *, chec!co**an"s.cfg-sa* le chec!co**an"s.cfg $4. Run *, *ini*al.cfg-sa* le *ini*al.cfg $(. Run *, *iscco**an"s.cfg-sa* le *iscco**an"s.cfg $5. Run *, nagios.cfg-sa* le nagios.cfg 5&. Run *, resource.cfg-sa* le resource.cfg 5%. Run r* #igger.cfg-sa* le 52. Run ,i* *ini*al.cfg or use te-t e"itor 5'. /elete Dor co**ent outE all lines fro* the to of BF CO00:N/SB to the to of BF CON8:C8SB as these chec! co**an"s are alrea"y "efine" in chec!co**an"s.cfg 5$. 2oto 3 55. Run B3usr3local3nagios3#in3nagios -, 3usr3local3nagios3etc3nagios.cfgB to chec! the configs 5). Run 3etc3rc."3init."3nagios start 54. @ro* your fa,orite we# #rowser oint to htt :33;ser,erCna*e<3nagios an" enter nagiosa"*in as the userna*e an" your asswor" as the asswor" Nagios /irectory Structure : #in ,etc,li#e-ec,s#in,share,,ar 5(E 0o"ify the 3etc3ser,ices file an" configure NRP= to run un"er inet", -inet", or e"it 3etc3rc."3rc.local to run it as a stan"alone "ae*on using the init-scri t. 55E Call 3etc3rc."3init."3nr e start an" test it out So*e tests to run: @ro* you nagios ser,er , run: Co"e: 3usr3local3nagios3li#e-ec3chec!Cnr e GH HOS8N:0= Aou shoul" recei,e: Co"e: NRP= I2.5.% 8his *eans the nagios ser,er can tal! to the re*ote NRP= "ae*on .Howe,er, chec! scri ts. : test of the chec!C"is! scri t coul" #e acco* lishe" #y running. --=N/--

Vous aimerez peut-être aussi