{"id":306724,"date":"2020-07-09T21:00:39","date_gmt":"2020-07-09T21:00:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306724"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306724","title":{"rendered":"\u0414\u043e\u0432\u0435\u0440\u044f\u0439, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439: \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0435\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0438\u0441\u0435\u043c \u0432 \u0411\u0438\u0442\u0440\u0438\u043a\u0441\u0435 \u0441 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435\u043c \u0430\u0434\u043c\u0438\u043d\u0443"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/510352\/\">\n<h1>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h1>\n<p>  \u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0435\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u00ab1\u0421-\u0411\u0438\u0442\u0440\u0438\u043a\u0441: \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0430\u0439\u0442\u043e\u043c\u00bb (\u0434\u0430\u043b\u0435\u0435 \u0411\u0438\u0442\u0440\u0438\u043a\u0441) \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e\u0431 \u044d\u0442\u043e\u043c. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043f\u043e\u0447\u0442\u044b \u0431\u044b\u043b\u0438 \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u0434\u043a\u0438\u043c\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438, \u0442.\u043a. \u043e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0438 \u0437\u0430\u043a\u0430\u0437\u044b, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u0438\u0441\u044c\u043c\u0430. <\/p>\n<p>  \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <b>\u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0411\u0438\u0442\u0440\u0438\u043a\u0441\u043e\u043c \u043c\u0435\u0442\u043e\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u043e\u0447\u0442\u044b \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c<\/b>(\u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432 \u044d\u0442\u043e\u043c), \u0442\u043e <b>\u044d\u0442\u0438\u043c \u0436\u0435 \u0441\u0430\u043c\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043d\u0430\u0434\u0451\u0436\u043d\u043e<\/b>.<br \/>  <a name=\"habracut\"><\/a><br \/>  <a href=\"https:\/\/www.google.com\/search?q=%D0%B1%D0%B8%D1%82%D1%80%D0%B8%D0%BA%D1%81+%D0%BA%D0%BE%D0%BD%D1%82%D1%80%D0%BE%D0%BB%D1%8C+%D0%BD%D0%B5%D0%BE%D1%82%D0%BF%D1%80%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%BD%D1%8B%D1%85+%D0%BF%D0%B8%D1%81%D0%B5%D0%BC\" rel=\"nofollow\">\u041f\u043e\u0433\u0443\u0433\u043b\u0438\u0432<\/a>, \u044f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u0447\u0435\u0433\u043e-\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u0438 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b \u043d\u0435\u043c\u0430\u043b\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432\/\u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043e \u043d\u0435\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0438\u0441\u044c\u043c\u0430\u0445 \u0438\u0437 \u0411\u0438\u0442\u0440\u0438\u043a\u0441\u0430 \u2014 \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0445 \u043d\u0430\u0439\u0442\u0438, \u043a\u0430\u043a\u0438\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u0438\u0445 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0442.\u043f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0447\u0451\u043b \u043d\u0443\u0436\u043d\u044b\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c.<\/p>\n<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p>  <\/p>\n<ol>\n<li>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u044b \u0434\u043b\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0411\u0414 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0441\u0430\u0439\u0442\u0430 \u0411\u0438\u0442\u0440\u0438\u043a\u0441\u0430<\/li>\n<li>\u0421\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0441 \u0411\u0414<\/li>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0438\u0441\u0435\u043c<\/li>\n<li>\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u043c<\/li>\n<li>\u041f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f<\/li>\n<\/ol>\n<h1>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h1>\n<p>  \u041d\u0430 \u0432\u0445\u043e\u0434 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c 3 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:<\/p>\n<ol>\n<li>\u041f\u0443\u0442\u044c \u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443 \u0441\u0430\u0439\u0442\u0430 \u0411\u0438\u0442\u0440\u0438\u043a\u0441\u0430 (path_to_bxdb_config)<\/li>\n<li>\u0422\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0411\u0414 (single_num_value_query)<\/li>\n<li>\u041f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430\u044f \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 (max_num_value)<\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0411\u0414 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 check_bx_db_value.sh<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#!\/bin\/bash # # Site: https:\/\/github.com\/AlexeyGogolev\/check-bx-db-value # mysql=&quot;$(which mysql)&quot; # \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0443\u0442\u0438 \u043a mysql php=&quot;$(which php)&quot; # \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0443\u0442\u0438 \u043a php declare -A CLParams # \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u041a\u0421 declare -a CLParams_keys # \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u041a\u0421 declare -A DBSettings # \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 declare -a DBSettings_keys # \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 DBSettings_keys=(DBLogin DBPassword DBName) CLParams_keys=(path_to_bxdb_config single_num_value_query max_num_value) param_num=0 # \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u041a\u0421 # \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u041a\u0421 for key in &quot;${CLParams_keys[@]}&quot; ; do      ((param_num++))                      CLParams[$key]=${!param_num}    # ${!param_num} \u0437\u0434\u0435\u0441\u044c \u0433\u0435\u043d\u0435\u0440\u0438-\u0442 $1 $2...  done # \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0440\u0430\u0432\u043a\u0443 if  [ -z &quot;${CLParams[${CLParams_keys[$param_num-1]}]}&quot; ] ; then     printf &quot;Script compares result returned by &lt;${CLParams_keys[1]}&gt; to given &lt;${CLParams_keys[2]}&gt;.\\nIf the result more than the given value, then exit with code 1, else exit 0.\\n&quot;     printf &quot;Usage: \\n\\t$(basename ${BASH_SOURCE[0]}) &quot; ; for key in &quot;${CLParams_keys[@]}&quot; ; do printf &quot;&lt;$key&gt; &quot;; done ; printf &quot;\\n&quot;     printf &quot;Example: \\n\\t$(basename ${BASH_SOURCE[0]}) \\&quot;\/www\/ab.cd\/bitrix\/php_interface\/dbconn.php\\&quot; \\&quot;select count(id) from b_event where SUCCESS_EXEC&lt;&gt;'Y'\\&quot; 5\\n&quot;      exit 10 fi # \u0432\u044b\u0445\u043e\u0434 \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433 \u043f\u0443\u0441\u0442\u043e\u0439 \u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442  if ! [ -s &quot;${CLParams[path_to_bxdb_config]}&quot; ] ; then      printf &quot;File ${CLParams[path_to_bxdb_config]} doesn't exist or empty.\\n&quot;     exit 20 fi # \u0432\u044b\u0445\u043e\u0434 \u0435\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0411\u0414 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u0437 &quot;\u0437\u0430\u043f\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430&quot; echo ${CLParams[single_num_value_query]} | grep -i -q -E 'delete|update|insert|drop' &amp;&amp; printf &quot;query \\n${CLParams[single_num_value_query]}\\nisn't allowed\\n&quot; &amp;&amp; exit 30 # \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u0437 php-config -n -- \u0431\u0435\u0437 php.ini , -r -- \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u0431\u0435\u0437 \u0442\u044d\u0433\u043e\u0432 &lt;?...?&gt; for key in &quot;${DBSettings_keys[@]}&quot; ; do      DBSettings[$key]=&quot;$($php -n -r 'include(&quot;'${CLParams[path_to_bxdb_config]}'&quot;); print $'$key';')&quot; done # \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u043f\u0430\u0440\u043e\u043b\u044f mysql \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u043f\u043e \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438) export MYSQL_PWD=${DBSettings[DBPassword]} # \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0411\u0414: -N -- \u0431\u0435\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439 \u043a\u043e\u043b\u043e\u043d\u043e\u043a ; -B - (batch) - \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0435\u0437 &quot;\u0431\u043e\u043a\u0441\u0430&quot; \u0432\u043e\u043a\u0440\u0443\u0433 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439; -e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 num_value=`${mysql} -u ${DBSettings[DBLogin]} -N -B -e &quot;use ${DBSettings[DBName]}; ${CLParams[single_num_value_query]}&quot;` # \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 echo &quot;Result of the query (from DB ${DBSettings[DBName]}): ${num_value}, ${CLParams_keys[2]}: ${CLParams[max_num_value]}&quot; # \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 if [ $num_value -gt ${CLParams[max_num_value]} ]; then     exit 1 fi <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 ab_cd_unsent_check.sh<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#!\/bin\/bash check_bx_db_value.sh \\ \u00ab\/www\/ab.cd\/bitrix\/php_interface\/dbconn.php\u00bb \\ \u00abselect count(id) from b_event where SUCCESS_EXEC&lt;&gt;'Y'\u00bb \\ 2<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441 \u043a\u043e\u0434\u0430\u043c\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n<pre><code class=\"plaintext\">$ .\/ab_cd_unsent_check.sh &amp;&amp; echo &quot;success&quot; || echo &quot;failure&quot;<\/code><\/pre>\n<p>  \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<pre><code class=\"plaintext\">Result of the query (from DB ab_cd): 0, max_num_value: 2 success<\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u043d\u043e\u0432\u0430.<\/p>\n<pre><code class=\"plaintext\">$ .\/ab_cd_unsent_check.sh &amp;&amp; echo &quot;success&quot; || echo &quot;failure&quot;<\/code><\/pre>\n<p>  \u0430 \u0442\u0435\u043f\u0435\u0440\u044c:<\/p>\n<pre><code class=\"plaintext\">Result of the query (from DB ab_cd): 4, max_num_value: 2 failure<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e! \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0411\u0414 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e, \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u0434\u0430\u0435\u0442 \u043a\u043e\u0434 0 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0411\u0414 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435, \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u043e\u0434\u043e\u043c \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<h1>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 monit<\/h1>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 monit \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0430 e-mail.<br \/>  \u041f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d monit.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438, <b>\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 monitrc \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0430 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u043c \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0411\u0438\u0442\u0440\u0438\u043a\u0441\u043e\u043c \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u0435\u043c<\/b>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0443\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 monit \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 <a href=\"https:\/\/habr.com\/ru\/post\/492728\/\">\u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u044b<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/post\/265563\/\">\u0441\u043e\u0446\u0441\u0435\u0442\u0438<\/a>.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 monit<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">check program ab_cd_unsent_check with path \/home\/bitrix\/scripts\/ab_cd_unsent_check.sh every 2 cycles     group mail if status != 0 then alert<\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \/etc\/monit.d\/.   <\/div>\n<\/p><\/div>\n<p>  \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e 2 \u0446\u0438\u043a\u043b\u0430 (\u0437\u0434\u0435\u0441\u044c 1 \u0446\u0438\u043a\u043b = 30 \u0441\u0435\u043a). <br \/>  \u0427\u0442\u043e\u0431\u044b monit \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u043b\u043e\u0436\u043d\u044b\u0435 \u0430\u043b\u0435\u0440\u0442\u044b, \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0446\u0438\u043a\u043b\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u0438\u0441\u044c\u043c\u0430 \u0443\u0441\u043f\u0435\u0432\u0430\u043b\u0438 \u0443\u0445\u043e\u0434\u0438\u0442\u044c \u2014 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c. \u0417\u0434\u0435\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0441\u0430\u0439\u0442\u043e\u043c, \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c(\u0432\u0440\u0435\u043c\u044f) \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c:  <\/p>\n<pre><code class=\"plaintext\"># systemctl restart monit # monit status<\/code><\/pre>\n<p>  \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0411\u0435\u0437 \u043d\u0435\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/b>                         <\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-6\/jk\/gh\/-6jkghwrilvh67x8xj-m0pg8pue.png\">  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421 \u043d\u0435\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bd\/mp\/vh\/bdmpvhzaayt-spmqarh8fie8klc.png\">  <\/div>\n<\/p><\/div>\n<p>  \u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e\u0442 monit \u043d\u0430 \u043f\u043e\u0447\u0442\u0443:  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0435\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f!<\/b>                         <\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/i3\/8q\/43\/i38q43s9tzn3kgmzzumqtvrnmmu.png\">  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0412\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b (\u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u043d\u043e\u0440\u043c.).<\/b>                         <\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ux\/tq\/8d\/uxtq8difs0xipx9slwumq3sg7za.png\">  <\/div>\n<\/p><\/div>\n<p>  \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438\u0437 monit \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e. <\/p>\n<h1>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0451! \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/github.com\/AlexeyGogolev\/check-bx-db-value\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  P.S. \u041a\u043e\u043c\u0443 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u2014 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438? <br \/>  \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u043d\u0438 \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f?<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/510352\/\"> https:\/\/habr.com\/ru\/post\/510352\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/510352\/\">\n<h1>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h1>\n<p>  \u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0435\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u00ab1\u0421-\u0411\u0438\u0442\u0440\u0438\u043a\u0441: \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0430\u0439\u0442\u043e\u043c\u00bb (\u0434\u0430\u043b\u0435\u0435 \u0411\u0438\u0442\u0440\u0438\u043a\u0441) \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e\u0431 \u044d\u0442\u043e\u043c. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043f\u043e\u0447\u0442\u044b \u0431\u044b\u043b\u0438 \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u0434\u043a\u0438\u043c\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438, \u0442.\u043a. \u043e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0438 \u0437\u0430\u043a\u0430\u0437\u044b, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u0438\u0441\u044c\u043c\u0430. <\/p>\n<p>  \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <b>\u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0411\u0438\u0442\u0440\u0438\u043a\u0441\u043e\u043c \u043c\u0435\u0442\u043e\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u043e\u0447\u0442\u044b \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c<\/b>(\u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432 \u044d\u0442\u043e\u043c), \u0442\u043e <b>\u044d\u0442\u0438\u043c \u0436\u0435 \u0441\u0430\u043c\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043d\u0430\u0434\u0451\u0436\u043d\u043e<\/b>.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-306724","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306724"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306724\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}