{"id":98,"date":"2014-02-13T16:07:00","date_gmt":"2014-02-13T16:07:00","guid":{"rendered":"http:\/\/blog.successionua.com\/?p=98"},"modified":"2014-02-13T16:07:00","modified_gmt":"2014-02-13T16:07:00","slug":"%d1%83%d1%81%d1%82%d0%b0%d0%bd%d0%be%d0%b2%d0%ba%d0%b0-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d1%8b-%d0%bc%d0%be%d0%bd%d0%b8%d1%82%d0%be%d1%80%d0%b8%d0%bd%d0%b3%d0%b0-nagios-core-4-%d0%bd%d0%b0-linux-de","status":"publish","type":"post","link":"https:\/\/geckich.space\/?p=98","title":{"rendered":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 Nagios Core 4 \u043d\u0430 Linux Debian 6"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left;\">\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 <b>Nagios Core 4<\/b> \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c <b>Linux Debian 6 (Squeeze)<\/b>. \u0417\u0434\u0435\u0441\u044c \u0438\u0437\u043b\u043e\u0436\u0443 \u0441\u0432\u043e\u0439 \u043e\u043f\u044b\u0442. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043d\u0430 Debian 7, Ubuntu, \u0430 \u0442\u0430\u043a\u0436\u0435 RHEL-\u044b (CentOS, Oracle Linux, Fedora) Nagios \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u0445\u043e\u0434\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043b\u0438\u0448\u044c \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0443\u0442\u0435\u0439 \u043d\u0430 \u044d\u0442\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e Nagios, \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u0435\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u0439 \u0438 \u0442. \u0434. \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 <a href=\"http:\/\/www.nagios.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>.<\/p>\n<p>\u041f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b:<\/p>\n<ul style=\"text-align: left;\">\n<li>Nagios Core,&nbsp;<\/li>\n<li>Nagios Plugins,&nbsp;<\/li>\n<li>NRPE,&nbsp;<\/li>\n<li>Nagios V-Shell (\u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0444\u0440\u043e\u043d\u0442-\u044d\u043d\u0434 \u0434\u043b\u044f Nagios Core).&nbsp;<\/li>\n<\/ul>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0442\u0430\u043a \u0438 \u043f\u0443\u0442\u0451\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0442\u043e\u0434, \u0442. \u043a. \u043e\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Nagios, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043b\u0443\u0447\u0448\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439.<\/p>\n<p><a name='more'><\/a><br \/>1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<p><b><span style=\"color: #e69138;\">apt-get install wget build-essential apache2 php5-gd libgd2-xpm libgd2-xpm-dev libapache2-mod-php5 php-apc&nbsp;libssl-dev<\/span><\/b><\/p>\n<p>2. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0433\u0440\u0443\u043f\u043f<\/p>\n<p><b><span style=\"color: #e69138;\">useradd -m nagios<\/span><\/b><br \/><b><span style=\"color: #e69138;\">groupadd nagios<\/span><\/b><br \/><b><span style=\"color: #e69138;\">groupadd nagcmd<\/span><\/b><br \/><b><span style=\"color: #e69138;\">usermod -a -G nagcmd nagios<\/span><\/b><\/p>\n<p>3. \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0430\u0440\u0445\u0438\u0432\u043e\u0432. \u041d\u0430 \u043c\u043e\u043c\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f Nagios Core &#8211; 4.0.2, NRPE &#8211; 2.15<\/p>\n<p><b><span style=\"color: #e69138;\">mkdir downloads<\/span><\/b><br \/><b><span style=\"color: #e69138;\">cd downloads<\/span><\/b><br \/><b><span style=\"color: #e69138;\">wget http:\/\/prdownloads.sourceforge.net\/sourceforge\/nagios\/nagios-4.0.2.tar.gz<\/span><\/b><br \/><b><span style=\"color: #e69138;\">wget http:\/\/assets.nagios.com\/downloads\/nagiosplugins\/nagios-plugins-master.tar.gz<\/span><\/b><br \/><b><span style=\"color: #e69138;\">wget http:\/\/assets.nagios.com\/downloads\/exchange\/nagiosvshell\/vshell.tar.gz<\/span><\/b><br \/><b><span style=\"color: #e69138;\">wget http:\/\/sourceforge.net\/projects\/nagios\/files\/nrpe-2.x\/nrpe-2.15\/nrpe-2.15.tar.gz<\/span><\/b><\/p>\n<p>4. \u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430 \u0430\u0440\u0445\u0438\u0432\u043e\u0432<\/p>\n<p><b><span style=\"color: #e69138;\">tar zxvf nagios-4.0.2.tar.gz<\/span><\/b><br \/><b><span style=\"color: #e69138;\">tar zxvf nagios-plugins-master.tar.gz<\/span><\/b><br \/><b><span style=\"color: #e69138;\">tar -xzvf vshell.tar.gz<\/span><\/b><br \/><b><span style=\"color: #e69138;\">tar -xzvf nrpe-2.15.tar.gz<\/span><\/b><\/p>\n<p>5. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Nagios Core<\/p>\n<p><b><span style=\"color: #e69138;\">cd nagios-4.0.2<\/span><\/b><br \/><b><span style=\"color: #e69138;\">.\/configure &#8211;with-nagios-group=nagios &#8211;with-command-group=nagcmd &#8211;with-mail=\/usr\/bin\/sendmail<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make all<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make install&nbsp;<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make install-init<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make install-config<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make install-commandmode<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make install-webconf<\/span><\/b><br \/><b><span style=\"color: #e69138;\">cp -R contrib\/eventhandlers\/ \/usr\/local\/nagios\/libexec\/<\/span><\/b><br \/><b><span style=\"color: #e69138;\">chown -R nagios:nagios \/usr\/local\/nagios\/libexec\/eventhandlers<\/span><\/b><br \/><b><span style=\"color: #e69138;\">\/usr\/local\/nagios\/bin\/nagios -v \/usr\/local\/nagios\/etc\/nagios.cfg<\/span><\/b><\/p>\n<p>6. \u0410 \u0437\u0434\u0435\u0441\u044c \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u0447\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 4-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e \u0441 Debian 6. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 <b><span style=\"color: #e69138;\">\/etc\/init.d\/nagios<\/span><\/b> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p><span style=\"color: #e69138;\">#!\/bin\/sh<\/span><br \/><span style=\"color: #e69138;\"><br \/><\/span><span style=\"color: #e69138;\">### BEGIN INIT INFO<\/span><br \/><span style=\"color: #e69138;\"># Provides: nagios<\/span><br \/><span style=\"color: #e69138;\"># Required-Start: $remote_fs $syslog<\/span><br \/><span style=\"color: #e69138;\"># Required-Stop: $remote_fs $syslog<\/span><br \/><span style=\"color: #e69138;\"># Default-Start: 2 3 4 5<\/span><br \/><span style=\"color: #e69138;\"># Default-Stop: 0 1 6<\/span><br \/><span style=\"color: #e69138;\"># Short-Description: Start nagios daemon at boot time<\/span><br \/><span style=\"color: #e69138;\"># Description: Nagios 4.0.2 daemon&nbsp;<\/span><br \/><span style=\"color: #e69138;\">### END INIT INFO<\/span><br \/><span style=\"color: #e69138;\"><br \/><\/span><span style=\"color: #e69138;\">#<\/span><br \/><span style=\"color: #e69138;\"># chkconfig: 345 99 01<\/span><br \/><span style=\"color: #e69138;\"># description: Nagios network monitor<\/span><br \/><span style=\"color: #e69138;\">#<\/span><br \/><span style=\"color: #e69138;\"># File : nagios<\/span><br \/><span style=\"color: #e69138;\">#<\/span><br \/><span style=\"color: #e69138;\"># Author : Jorge Sanchez Aymar (jsanchez@lanchile.cl)<\/span><br \/><span style=\"color: #e69138;\">#<\/span><br \/><span style=\"color: #e69138;\"># Description: Starts and stops the Nagios monitor<\/span><br \/><span style=\"color: #e69138;\"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;used to provide network services status.<\/span><br \/><span style=\"color: #e69138;\">#<\/span><br \/><span style=\"color: #e69138;\"># Load any extra environment variables for Nagios and its plugins<\/span><br \/><span style=\"color: #e69138;\"><br \/><\/span><span style=\"color: #e69138;\">if test -f \/etc\/sysconfig\/nagios; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp;. \/etc\/sysconfig\/nagios<\/span><br \/><span style=\"color: #e69138;\">fi<\/span><br \/><span style=\"color: #e69138;\">status_nagios ()<\/span><br \/><span style=\"color: #e69138;\">{<\/span><br \/><span style=\"color: #e69138;\">&nbsp;if test -x $NagiosCGI\/daemonchk.cgi; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; if $NagiosCGI\/daemonchk.cgi -l $NagiosRunFile; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0<\/span><br \/><span style=\"color: #e69138;\">&nbsp; else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;return 1<\/span><br \/><span style=\"color: #e69138;\">&nbsp; fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp;else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; if ps -p $NagiosPID &gt; \/dev\/null 2&gt;&amp;1; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0<\/span><br \/><span style=\"color: #e69138;\">&nbsp; else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;return 1<\/span><br \/><span style=\"color: #e69138;\">&nbsp; fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp;fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp;return 1<\/span><br \/><span style=\"color: #e69138;\">}<\/span><br \/><span style=\"color: #e69138;\">printstatus_nagios()<\/span><br \/><span style=\"color: #e69138;\">{<\/span><br \/><span style=\"color: #e69138;\">&nbsp;if status_nagios $1 $2; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; echo &#8220;nagios (pid $NagiosPID) is running&#8230;&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp;else<\/span><b\nr \/><span style=\"color: #e69138;\">&nbsp; echo &#8220;nagios is not running&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp;fi<\/span><br \/><span style=\"color: #e69138;\">}<\/span><br \/><span style=\"color: #e69138;\">killproc_nagios ()<\/span><br \/><span style=\"color: #e69138;\">{<\/span><br \/><span style=\"color: #e69138;\">&nbsp;kill $2 $NagiosPID<\/span><br \/><span style=\"color: #e69138;\">}<\/span><br \/><span style=\"color: #e69138;\">pid_nagios ()<\/span><br \/><span style=\"color: #e69138;\">{<\/span><br \/><span style=\"color: #e69138;\">&nbsp;if test ! -f $NagiosRunFile; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; echo &#8220;No lock file found in $NagiosRunFile&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; exit 1<\/span><br \/><span style=\"color: #e69138;\">&nbsp;fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp;NagiosPID=`head -n 1 $NagiosRunFile`<\/span><br \/><span style=\"color: #e69138;\">}<\/span><br \/><span style=\"color: #e69138;\"># Source function library<\/span><br \/><span style=\"color: #e69138;\"># Solaris doesn&#8217;t have an rc.d directory, so do a test first<\/span><br \/><span style=\"color: #e69138;\">if [ -f \/etc\/rc.d\/init.d\/functions ]; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp;. \/etc\/rc.d\/init.d\/functions<\/span><br \/><span style=\"color: #e69138;\">elif [ -f \/etc\/init.d\/functions ]; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp;. \/etc\/init.d\/functions<\/span><br \/><span style=\"color: #e69138;\">fi<\/span><br \/><span style=\"color: #e69138;\">prefix=\/usr\/local\/nagios<\/span><br \/><span style=\"color: #e69138;\">exec_prefix=${prefix}<\/span><br \/><span style=\"color: #e69138;\">NagiosBin=${exec_prefix}\/bin\/nagios<\/span><br \/><span style=\"color: #e69138;\">NagiosCfgFile=${prefix}\/etc\/nagios.cfg<\/span><br \/><span style=\"color: #e69138;\">NagiosStatusFile=${prefix}\/var\/status.dat<\/span><br \/><span style=\"color: #e69138;\">NagiosRetentionFile=${prefix}\/var\/retention.dat<\/span><br \/><span style=\"color: #e69138;\">NagiosCommandFile=${prefix}\/var\/rw\/nagios.cmd<\/span><br \/><span style=\"color: #e69138;\">NagiosVarDir=${prefix}\/var<\/span><br \/><span style=\"color: #e69138;\">NagiosRunFile=${prefix}\/var\/nagios.lock<\/span><br \/><span style=\"color: #e69138;\">NagiosLockDir=\/var\/lock\/subsys<\/span><br \/><span style=\"color: #e69138;\">NagiosLockFile=nagios<\/span><br \/><span style=\"color: #e69138;\">NagiosCGIDir=${exec_prefix}\/sbin<\/span><br \/><span style=\"color: #e69138;\">NagiosUser=nagios<\/span><br \/><span style=\"color: #e69138;\">NagiosGroup=nagios<\/span><br \/><span style=\"color: #e69138;\"># Check that nagios exists.<\/span><br \/><span style=\"color: #e69138;\">if [ ! -f $NagiosBin ]; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; echo &#8220;Executable file $NagiosBin not found. &nbsp;Exiting.&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; exit 1<\/span><br \/><span style=\"color: #e69138;\">fi<\/span><br \/><span style=\"color: #e69138;\"># Check that nagios.cfg exists.<\/span><br \/><span style=\"color: #e69138;\">if [ ! -f $NagiosCfgFile ]; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; echo &#8220;Configuration file $NagiosCfgFile not found. &nbsp;Exiting.&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; exit 1<\/span><br \/><span style=\"color: #e69138;\">fi<\/span><br \/><span style=\"color: #e69138;\"># See how we were called.<\/span><br \/><span style=\"color: #e69138;\">case &#8220;$1&#8221; in<\/span><br \/><span style=\"color: #e69138;\">&nbsp;start)<\/span><br \/><span style=\"color: #e69138;\">&nbsp; echo -n &#8220;Starting nagios:&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; $NagiosBin -v $NagiosCfgFile &gt; \/dev\/null 2&gt;&amp;1;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; if [ $? -eq 0 ]; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;su &#8211; $NagiosUser -c &#8220;touch $NagiosVarDir\/nagios.log $NagiosRetentionFile&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;rm -f $NagiosCommandFile<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;touch $NagiosRunFile<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;chown $NagiosUser:$NagiosGroup $NagiosRunFile<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;$NagiosBin -d $NagiosCfgFile<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;if [ -d $NagiosLockDir ]; then touch $NagiosLockDir\/$NagiosLockFile; fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;echo &#8221; done.&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;exit 0<\/span><br \/><span style=\"color: #e69138;\">&nbsp; else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;echo &#8220;CONFIG ERROR! &nbsp;Start aborted. &nbsp;Check your Nagios configuration.&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;exit 1<\/span><br \/><span style=\"color: #e69138;\">&nbsp; fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp; ;;<\/span><br \/><span style=\"color: #e69138;\">&nbsp;stop)<\/span><br \/><span style=\"color: #e69138;\">&nbsp; echo -n &#8220;Stopping nagios: &#8220;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; pid_nagios<\/span><br \/><span style=\"color: #e69138;\">&nbsp; killproc_nagios nagios<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;# now we have to wait for nagios to exit and remove its<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;# own NagiosRunFile, otherwise a following &#8220;start&#8221; could<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;# happen, and then the exiting nagios will remove the<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;# new NagiosRunFile, allowing multiple nagios daemons<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;# to (sooner or later) run &#8211; John Sellens<\/span><br \/><span style=\"color: #e69138;\">&nbsp; #echo -n &#8216;Waiting for nagios to exit .&#8217;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;for i in 1 2 3 4 5 6 7 8 9 10 ; do<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp; &nbsp;if status_nagios &gt; \/dev\/null; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; echo -n &#8216;.&#8217;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; sleep 1<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp; &nbsp;else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; break<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp; &nbsp;fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;done<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;if status_nagios &gt; \/dev\/null; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp; &nbsp;echo &#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp; &nbsp;echo &#8216;Warning &#8211; nagios did not exit in a timely manner&#8217;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp; &nbsp;echo &#8216;done.&#8217;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp; rm -f $NagiosStatusFile $NagiosRunFile $NagiosLockDir\/$NagiosLockFile $NagiosCommandFile<\/span><br \/><span style=\"color: #e69138;\">&nbsp; ;;<\/span><br \/><span style=\"color: #e69138;\">&nbsp;status)<\/span><br \/><span style=\"color: #e69138;\">&nbsp; pid_nagios<\/span><br \/><span style=\"color: #e69138;\">&nbsp; printstatus_nagios nagios<\/span><br \/><span style=\"color: #e69138;\">&nbsp; ;;<\/span><br \/><span style=\"color: #e69138;\">&nbsp;checkconfig)<\/span><br \/><span style=\"color: #e69138;\">&nbsp; printf &#8220;Running configuration check&#8230;&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; $NagiosBin -v $NagiosCfgFile &gt; \/dev\/null 2&gt;&amp;1;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; if [ $? -eq 0 ]; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;echo &#8221; OK.&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;echo &#8221; CONFIG ERROR! &nbsp;Check your Nagios configuration.&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;exit 1<\/span><br \/><span style=\"color: #e69138;\">&nbsp; fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp; ;;<\/span><br \/><span style=\"color: #e69138;\">&nbsp;restart)<\/span><br \/><span style=\"color: #e69138;\">&nbsp; printf &#8220;Running configuration check&#8230;&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; $NagiosBin -v $NagiosCfgFile &gt; \/dev\/null 2&gt;&amp;1;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; if [ $? -eq 0 ]; then<\/sp\nan><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;echo &#8220;done.&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;$0 stop<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;$0 start<\/span><br \/><span style=\"color: #e69138;\">&nbsp; else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;echo &#8221; CONFIG ERROR! &nbsp;Restart aborted. &nbsp;Check your Nagios configuration.&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;exit 1<\/span><br \/><span style=\"color: #e69138;\">&nbsp; fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp; ;;<\/span><br \/><span style=\"color: #e69138;\">&nbsp;reload|force-reload)<\/span><br \/><span style=\"color: #e69138;\">&nbsp; printf &#8220;Running configuration check&#8230;&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; $NagiosBin -v $NagiosCfgFile &gt; \/dev\/null 2&gt;&amp;1;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; if [ $? -eq 0 ]; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;echo &#8220;done.&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;if test ! -f $NagiosRunFile; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; $0 start<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; pid_nagios<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; if status_nagios &gt; \/dev\/null; then<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp;printf &#8220;Reloading nagios configuration&#8230;&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp;killproc_nagios nagios -HUP<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp;echo &#8220;done&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp;$0 stop<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; &nbsp;$0 start<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp; fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp; else<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;echo &#8221; CONFIG ERROR! &nbsp;Reload aborted. &nbsp;Check your Nagios configuration.&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;exit 1<\/span><br \/><span style=\"color: #e69138;\">&nbsp; fi<\/span><br \/><span style=\"color: #e69138;\">&nbsp; ;;<\/span><br \/><span style=\"color: #e69138;\">&nbsp;*)<\/span><br \/><span style=\"color: #e69138;\">&nbsp; echo &#8220;Usage: nagios {start|stop|restart|reload|force-reload|status|checkconfig}&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; exit 1<\/span><br \/><span style=\"color: #e69138;\">&nbsp; ;;<\/span><br \/><span style=\"color: #e69138;\">esac<\/span><br \/><span style=\"color: #e69138;\"># End of this script<\/span><\/p>\n<div><\/div>\n<div>7. \u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Nagios \u0432 \u0430\u0432\u0442\u043e\u0441\u0442\u0430\u0440\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0434\u0435\u043c\u043e\u043d\u0430<\/div>\n<div><\/div>\n<div><b><span style=\"color: #e69138;\">update-rc.d nagios defaults<\/span><\/b><\/div>\n<div><b><span style=\"color: #e69138;\">service nagios start<\/span><\/b><\/div>\n<p>8. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 Apache<br \/>8.1. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 Nagios:<\/p>\n<p><b><span style=\"color: #e69138;\">htpasswd -c \/usr\/local\/nagios\/etc\/htpasswd.users nagiosadmin&nbsp;<\/span><\/b><\/p>\n<p>8.2. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c<b><span style=\"color: #e69138;\"> ssl<\/span><\/b>, \u0442. \u043a. \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 &#8211; \u044d\u0442\u043e \u043a\u0430\u043a-\u0442\u043e \u043d\u0435 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u043e.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443 \u0434\u0430\u0441\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 CA, \u043d\u043e \u043e\u043d \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043d\u0435\u0433 (\u043e\u043a\u043e\u043b\u043e 99$ \u0432 \u0433\u043e\u0434 &#8211; \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0446\u0435\u043d \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 CA), \u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c &#8211; \u043f\u0443\u0441\u0442\u044c \u0438 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e &#8211; \u043c\u043e\u0436\u043d\u043e \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b \u043e\u0441\u0442\u0430\u0451\u0442\u0435\u0441\u044c \u0443\u044f\u0437\u0432\u0438\u043c\u044b\u043c\u0438 \u0434\u043b\u044f \u0442. \u043d. <a href=\"http:\/\/ru.wikipedia.org\/wiki\/%D0%A7%D0%B5%D0%BB%D0%BE%D0%B2%D0%B5%D0%BA_%D0%BF%D0%BE%D1%81%D0%B5%D1%80%D0%B5%D0%B4%D0%B8%D0%BD%D0%B5\" target=\"_blank\" rel=\"noopener noreferrer\">man-in-the-middle attack<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><b><span style=\"color: #e69138;\">mkdir \/etc\/apache2\/ssl<\/span><\/b><br \/><b><span style=\"color: #e69138;\">cd \/etc\/apache2\/ssl<\/span><\/b><br \/><b><span style=\"color: #e69138;\">openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout nagios.key -out nagios.crt<\/span><\/b><\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 apache2 \u0434\u043b\u044f ssl.<br \/>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433, \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0432 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:<\/p>\n<p><b><span style=\"color: #e69138;\">rm \/etc\/apache2\/conf.d\/nagios.conf<\/span><\/b><\/p>\n<p>\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 ssl:<\/p>\n<p><b><span style=\"color: #e69138;\">nano \/etc\/apache2\/sites-available\/default-ssl.conf<\/span><\/b><\/p>\n<p>\u041a\u0443\u0434\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435, \u0438\u0437\u043c\u0435\u043d\u044f\u044f \u043d\u0430 \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f:<\/p>\n<p><span style=\"color: #e69138;\">&lt;IfModule mod_ssl.c&gt;<\/span><br \/><span style=\"color: #e69138;\">&lt;VirtualHost *:443&gt;<\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\"> <\/span>ServerAdmin webmaster@example.com<\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\"> <\/span>DocumentRoot \/var\/www\/<\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\"> <\/span>ErrorLog ${APACHE_LOG_DIR}\/error.log<\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\"> <\/span>LogLevel warn<\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\"> <\/span>CustomLog ${APACHE_LOG_DIR}\/ssl_access.log combined<\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\"> <\/span>SSLEngine on<\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\"> <\/span>SSLCertificateFile &nbsp; &nbsp;\/etc\/ssl\/certs\/ssl-cert-snakeoil.pem<\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\"> <\/span>SSLCertificateKeyFile \/etc\/ssl\/private\/ssl-cert-snakeoil.key<\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\"> <\/span>BrowserMatch &#8220;MSIE [2-6]&#8221; <\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\">  <\/span>nokeepalive ssl-unclean-shutdown <\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\">  <\/span>downgrade-1.0 force-response-1.0<\/span><br \/><span style=\"color: #e69138;\"><span style=\"white-space: pre;\"> <\/span>BrowserMatch &#8220;MSIE [17-9]&#8221; ssl-unclean-shutdown<\/span><br \/><span style=\"color: #e69138;\">&lt;Directory \/&gt;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; Options -Indexes<\/span><br \/><span style=\"color: #e69138;\">&lt;\/Directory&gt;<\/span><br \/><span style=\"color: #e69138;\">ScriptAlias \/nagios\/cgi-bin &#8220;\/usr\/local\/nagios\/sbin&#8221;<\/span><br \/><span style=\"color: #e69138;\">&lt;Directory &#8220;\/usr\/local\/nagios\/sbin&#8221;&gt;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;SSLRequireSSL<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;Options ExecCGI<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;AllowOverride None<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;Order allow,deny<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;Allow from all<\/span><br \/><span style=\"color: #e69138;\"># &nbsp;Order deny,allow<\/span><br \/><span style=\"color: #e69138;\"># &nbsp;Deny from all<\/span><br \/><span style=\"color: #e69138;\"># &nbsp;Allow from 127.0.0.1<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;AuthName &#8220;Nagios Access&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;AuthType Basic<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;AuthUserFile \/usr\/local\/nagios\/etc\/htpasswd.users<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;Requir<br \/>\ne valid-user<\/span><br \/><span style=\"color: #e69138;\">&lt;\/Directory&gt;<\/span><br \/><span style=\"color: #e69138;\">Alias \/nagios &#8220;\/usr\/local\/nagios\/share&#8221;<\/span><br \/><span style=\"color: #e69138;\">&lt;Directory &#8220;\/usr\/local\/nagios\/share&#8221;&gt;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;SSLRequireSSL<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;Options None<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;AllowOverride None<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;Order allow,deny<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;Allow from all<\/span><br \/><span style=\"color: #e69138;\"># &nbsp;Order deny,allow<\/span><br \/><span style=\"color: #e69138;\"># &nbsp;Deny from all<\/span><br \/><span style=\"color: #e69138;\"># &nbsp;Allow from 127.0.0.1<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;AuthName &#8220;Nagios Access&#8221;<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;AuthType Basic<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;AuthUserFile \/usr\/local\/nagios\/etc\/htpasswd.users<\/span><br \/><span style=\"color: #e69138;\">&nbsp; &nbsp;Require valid-user<\/span><br \/><span style=\"color: #e69138;\">&lt;\/Directory&gt;<\/span><br \/><span style=\"color: #e69138;\">&lt;\/VirtualHost&gt;<\/span><br \/><span style=\"color: #e69138;\">&lt;\/IfModule&gt;<\/span><\/p>\n<div><\/div>\n<p>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c ssl, \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u043d\u0430\u0448 ssl-\u0441\u0430\u0439\u0442 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043b\u0443\u0436\u0431\u0443:<\/p>\n<p><b><span style=\"color: #e69138;\">a2enmod ssl<\/span><\/b><br \/><b><span style=\"color: #e69138;\">a2enmod cgi<\/span><\/b><br \/><b><span style=\"color: #e69138;\">a2ensite default-ssl<\/span><\/b><br \/><b><span style=\"color: #e69138;\">\/etc\/init.d\/apache2 restart<\/span><\/b><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0432\u0435\u0440\u044f\u0435\u043c. \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <b><span style=\"color: #e69138;\">https:\/\/IP\/nagios<\/span><\/b> \u0438 \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0440\u0430\u0448\u043d\u044b\u0439 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Nagios Core:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"http:\/\/4.bp.blogspot.com\/-3X-OFfbL4l0\/UvzhBteLgbI\/AAAAAAAADlY\/8DWAVm3eSW8\/s1600\/Screenshot+from+2014-02-13+17:11:43.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"436\" src=\"https:\/\/4.bp.blogspot.com\/-3X-OFfbL4l0\/UvzhBteLgbI\/AAAAAAAADlY\/8DWAVm3eSW8\/s1600\/Screenshot+from+2014-02-13+17:11:43.png\" width=\"640\" \/><\/a><\/div>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0445\u043e\u0434\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c \u0432 \u043d\u0451\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.<\/p>\n<p>9. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Nagios plugins<\/p>\n<p><b><span style=\"color: #e69138;\">cd ..\/nagios-plugins-1.5-8-g9db76<\/span><\/b><br \/><b><span style=\"color: #e69138;\">which openssl<\/span><\/b><br \/><b><span style=\"color: #e69138;\">.\/configure &#8211;with-nagios-user=nagios &#8211;with-nagios-group=nagios &#8211;with-openssl=\/usr\/bin\/openssl &#8211;enable-perl-modules &#8211;enable-libtap<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make install<\/span><\/b><\/p>\n<p>10. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c NRPE<\/p>\n<p><b><span style=\"color: #e69138;\">cd ..\/nrpe-2.15<\/span><\/b><br \/><b><span style=\"color: #e69138;\">.\/configure &#8211;with-ssl=\/usr\/bin\/openssl &#8211;with-ssl-lib=\/usr\/lib\/x86_64-linux-gnu<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make all<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make install<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make install-plugin<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make install-daemon<\/span><\/b><br \/><b><span style=\"color: #e69138;\">make install-daemon-config<\/span><\/b><br \/><b><span style=\"color: #e69138;\">cp init-script.debian \/etc\/init.d\/nrpe<\/span><\/b><br \/><b><span style=\"color: #e69138;\">chmod 700 \/etc\/init.d\/nrpe<\/span><\/b><br \/><b><span style=\"color: #e69138;\">\/etc\/init.d\/nrpe start<\/span><\/b><\/p>\n<p>\u0420\u0430\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442<\/p>\n<p><b><span style=\"color: #e69138;\">nano \/etc\/init.d\/nrpe<\/span><\/b><\/p>\n<p>\u0418 \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 Debian \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0444\u0430\u0439\u043b\u0430:<\/p>\n<p><span style=\"color: #e69138;\">#!\/bin\/sh<\/span><br \/><span style=\"color: #e69138;\"># Start\/stop the nrpe daemon.<\/span><br \/><span style=\"color: #e69138;\">#<\/span><br \/><span style=\"color: #e69138;\"># Contributed by Andrew Ryder 06-22-02<\/span><br \/><span style=\"color: #e69138;\"># Slight mods by Ethan Galstad 07-09-02<\/span><br \/><span style=\"color: #e69138;\"><br \/><\/span><span style=\"color: #e69138;\">### BEGIN INIT INFO<\/span><br \/><span style=\"color: #e69138;\"># Provides: nrpe<\/span><br \/><span style=\"color: #e69138;\"># Required-Start: $remote_fs $syslog<\/span><br \/><span style=\"color: #e69138;\"># Required-Stop: $remote_fs $syslog<\/span><br \/><span style=\"color: #e69138;\"># Default-Start: 2 3 4 5<\/span><br \/><span style=\"color: #e69138;\"># Default-Stop: 0 1 6<\/span><br \/><span style=\"color: #e69138;\"># Short-Description: Start nrpe daemon at boot time<\/span><br \/><span style=\"color: #e69138;\"># Description: nrpe daemon 2.15<\/span><br \/><span style=\"color: #e69138;\">### END INIT INFO<\/span><\/p>\n<p>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a:<\/p>\n<p><b><span style=\"color: #e69138;\">update-rc.d nrpe defaults<\/span><\/b><\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0432 \u0444\u0430\u0439\u043b \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 Nagios&#8217;a <b><span style=\"color: #e69138;\">\/usr\/local\/nagios\/etc\/objects\/commands.cfg<\/span><\/b> \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f NRPE \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<p><span style=\"color: #e69138; font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace; font-size: xx-small;\">define command{<\/span><br \/><span style=\"color: #e69138; font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace; font-size: xx-small;\">&nbsp; &nbsp; &nbsp; &nbsp; command_name &nbsp; &nbsp;check_nrpe<\/span><br \/><span style=\"color: #e69138; font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace; font-size: xx-small;\">&nbsp; &nbsp; &nbsp; &nbsp; command_line &nbsp; &nbsp;$USER1$\/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 30<\/span><br \/><span style=\"color: #e69138; font-family: &quot;courier new&quot; , &quot;courier&quot; , monospace; font-size: xx-small;\">&nbsp; &nbsp; &nbsp; &nbsp; }<\/span><\/p>\n<div><\/div>\n<p>11. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c vshell. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0432 \u0444\u0430\u0439\u043b\u0435 <b><span style=\"color: #e69138;\">install.php<\/span><\/b> \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0434\u043b\u044f RHEL \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432:<\/p>\n<p><span style=\"color: #e69138;\">\/\/define(&#8216;APACHECONF&#8217;,&#8221;\/etc\/httpd\/conf.d&#8221;);<\/span><\/p>\n<p>\u0410 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u0443\u044e \u0434\u043b\u044f Debian:<\/p>\n<p><span style=\"color: #e69138;\">define(&#8216;APACHECONF&#8217;,&#8221;\/etc\/apache2\/conf.d&#8221;);<\/span><\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<p><b><span style=\"color: #e69138;\">cd ..\/vshell<\/span><\/b><br \/><b><span style=\"color: #e69138;\">nano install.php<\/span><\/b><br \/><b><span style=\"color: #e69138;\">.\/install.php<\/span><\/b><\/p>\n<div><\/div>\n<div>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <b><span style=\"color: #e69138;\">https:\/\/IP\/vshell<\/span><\/b>.<\/div>\n<div><\/div>\n<div style=\"clear: both; text-align: center;\"><a href=\"http:\/\/3.bp.blogspot.com\/-hmBpqSmTNmY\/UvzpnGQae_I\/AAAAAAAADlo\/3OtTqE9zEUI\/s1600\/Screenshot+from+2014-02-13+17:48:53.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"290\" src=\"https:\/\/3.bp.blogspot.com\/-hmBpqSmTNmY\/UvzpnGQae_I\/AAAAAAAADlo\/3OtTqE9zEUI\/s1600\/Screenshot+from+2014-02-13+17:48:53.png\" width=\"400\" \/><\/a><\/div>\n<div><\/div>\n<div>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Nagios \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c. \u041d\u043e, \u044d\u0442\u043e \u0443\u0436\u0435 \u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.&nbsp;<\/div>\n<div><\/div>\n<div>\u041d\u0430\u0434\u0435\u044e\u0441\u044c &#8211; \u0434\u0430\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b \u043e\u0431\u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433.<\/div>\n<div><\/div>\n<div>\u0421\u0441\u044b\u043b\u043a\u0438:<\/div>\n<div>\n<ul style=\"text-align: left;\">\n<li><a h ref=\"http:\/\/www.nagios.org\/download\/core\" target=\"_blank\" rel=\"noopener noreferrer\">Nagios Monitoring Software Editions<\/a><\/li>\n<li><a href=\"http:\/\/nagios.sourceforge.net\/docs\/nagioscore\/4\/en\/toc.html\" target=\"_blank\" rel=\"noopener noreferrer\">Nagios Core Documentation<\/a><\/li>\n<li><a href=\"http:\/\/www.nagios.org\/download\/frontends\/\" target=\"_blank\" rel=\"noopener noreferrer\">Nagios Frontends<\/a><\/li>\n<li><a href=\"http:\/\/assets.nagios.com\/downloads\/nagioscore\/docs\/Intro_To_Nagios_Vshell.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">Nagios V-shell intro pdf<\/a><\/li>\n<li><a href=\"http:\/\/www.nagios.org\/download\/plugins\/\" target=\"_blank\" rel=\"noopener noreferrer\">Nagios Plugins<\/a><\/li>\n<li><a href=\"http:\/\/exchange.nagios.org\/directory\/Addons\/Monitoring-Agents\/NRPE--2D-Nagios-Remote-Plugin-Executor\/details\" target=\"_blank\" rel=\"noopener noreferrer\">NRPE &#8211; Nagios Remote Plugin Executor<\/a><\/li>\n<li><a href=\"http:\/\/midactstech.blogspot.com\/2013\/11\/nagios-core-installation-script-for.html\" target=\"_blank\" rel=\"noopener noreferrer\">\u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Nagios Core<\/a><\/li>\n<li><a href=\"http:\/\/forums.debian.net\/viewtopic.php?f=30&amp;t=53192\" target=\"_blank\" rel=\"noopener noreferrer\">\u0422\u0435\u043c\u0430 \u0441 \u0444\u0438\u043a\u0441\u043e\u043c \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 Debian<\/a><\/li>\n<\/ul>\n<div>UPD:<\/p>\n<\/div>\n<\/div>\n<div>1. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<\/div>\n<div>2. \u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 &#8220;Starting nagios:No directory, logging in with HOME=\/&#8221; \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0434\u043e\u043c\u0430\u0448\u043d\u044e\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f nagios. \u0414\u0435\u043b\u0430\u0435\u043c:&nbsp;<\/div>\n<\/div>\n<div dir=\"ltr\" style=\"text-align: left;\">mkdir \/home\/nagios <br \/>chown-R nagios:nagios \/home\/nagios<\/div>\n<div>http:\/\/geckich.blogspot.com\/<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 Nagios Core 4 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Linux Debian 6 (Squeeze). \u0417\u0434\u0435\u0441\u044c \u0438\u0437\u043b\u043e\u0436\u0443 \u0441\u0432\u043e\u0439 \u043e\u043f\u044b\u0442. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043d\u0430 Debian 7, Ubuntu, \u0430 \u0442\u0430\u043a\u0436\u0435 RHEL-\u044b (CentOS, Oracle Linux, Fedora) Nagios \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u0445\u043e\u0434\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043b\u0438\u0448\u044c \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0443\u0442\u0435\u0439 \u043d\u0430 \u044d\u0442\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e Nagios, \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 &hellip; <a href=\"https:\/\/geckich.space\/?p=98\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 Nagios Core 4 \u043d\u0430 Linux Debian 6<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-98","post","type-post","status-publish","format-standard","hentry","category-linux"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/posts\/98","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/geckich.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=98"}],"version-history":[{"count":1,"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/posts\/98\/revisions"}],"predecessor-version":[{"id":1232,"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/posts\/98\/revisions\/1232"}],"wp:attachment":[{"href":"https:\/\/geckich.space\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geckich.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geckich.space\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}