資源描述:
《完整安裝nagios郵件報(bào)警》由會(huì)員上傳分享,免費(fèi)在線(xiàn)閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫(kù)。
1、完整安裝nagios+cacti+短信和郵件報(bào)警一:安裝nagios中用到的其他軟件和庫(kù)文件yum-yinstallhttpdgccglibcglibc-commongdgd-develphpphp-mysqlmysqlmysql-servermysql-developenssl-devel二:安裝和配置nagios3.4.1監(jiān)控主程序2.1建立用戶(hù)和組groupaddnagcmduseradd–mnagiosusermod-a-Gnagcmdnagiosusermod-a-Gnagcmdapache2.2下載最新版nagios3.4.1mkdird
2、ownloadswgethttp://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.1.tar.gz2.3編譯安裝cddownloadstar–zxvfnagios-3.4.1.tar.gzcdnagios默認(rèn)安裝至/usr/local/nagios/./configure--with-command-group=nagcmd--enable-event-brokermakeall&&makeinstall&&makeinstall-init&&makeinstall-config
3、&&makeinstall-commandmode&&makeinstall-webconfWEB界面的用戶(hù)名和密碼htpasswd-c/usr/local/nagios/etc/htpasswd.usersnagiosadmin輸入密碼并確認(rèn)servicehttpdrestartchkconfighttpdon三:編譯安裝nagios-plugins-1.4.163.1下載最新版本nagios-plugins-1.4.16cddownloadswgethttp://prdownloads.sourceforge.net/sourceforge/na
4、giosplug/nagios-plugins-1.4.16.tar.gzcdnagios-plugins-1.4.16./configure--with-nagios-user=nagios--with-nagios-group=nagcmd--with-mysqlmake&&makeinstallchkconfig--addnagioschkconfignagiosonvim/etc/profile加入PATH=$PATH:/usr/local/nagios/bin檢查nagios語(yǔ)法是否正確nagios-v/usr/local/nagios/e
5、tc/nagios.cfgservicenagiosstart3.2關(guān)閉selinux及修改iptables或關(guān)閉iptables關(guān)閉selinux的方法vi/etc/sysconfig/selinux添加SELINUX=disablediptables建議開(kāi)啟,然后允許需要開(kāi)啟的端口,一般nagios需要的端口是80和5666(nrpe)vi/etc/sysconfig/iptablesservicehttpdrestart此時(shí)已經(jīng)能從瀏覽器訪問(wèn)http://****/nagios默認(rèn)用戶(hù)名nagiosadmin密碼是之前輸入過(guò)的。四:監(jiān)控nagi
6、os本機(jī)創(chuàng)建fund123目錄,用于存放所有相關(guān)配置文件cd/usr/local/nagios/etc/mkdirfund123cd/usr/local/nagios/etc/objectscp-v-R*/usr/local/nagios/etc/fund123/文件和目錄修改下權(quán)限chown-Rnagios:nagiosfund123修改主配置文件nagios.cfg,修改之前最好先備份下vi/usr/local/nagios/etc/nagios.cfg修改成cfg_file=/usr/local/nagios/etc/fund123/comma
7、nds.cfgcfg_file=/usr/local/nagios/etc/fund123/contacts.cfgcfg_file=/usr/local/nagios/etc/fund123/timeperiods.cfgcfg_file=/usr/local/nagios/etc/fund123/templates.cfgcfg_file=/usr/local/nagios/etc/fund123/contactgroups.cfgcfg_file=/usr/local/nagios/etc/fund123/hostgroups.cfgcfg_f
8、ile=/usr/local/nagios/etc/fund123/servicegroups.cfgcfg