<html>Dear supporter<br /><br />Now , i am installed nagios 4.4.6 with ubuntu 20.04 ,and take the procedure from next site:<br /><br />https://www.howtoforge.com/tutorial/how-to-install-nagios-on-ubuntu-2004/#:~:text=the%20Nagios%20server.-,%2D%20Install%20NRPE%20Server%20on%20the%20Client01%20Server,client01%22%20server%20using%20your%20ssh.&text=Once%20you've%20logged%20in,Nagios%20Plugins%20and%20NRPE%20Server.&text=Next%2C%20go%20to%20the%20NRPE,cfg%22.<br /><br />it running normal until Install Nagios Plugins and create folder server for all server hots configurations. and get script from inex like this :<br /><br /><span style="font-size:16px;"><strong>root@agios:/srv/nagios# ll</strong></span><br />total 48<br />drwxr-xr-x 2 root root 4096 Sep 29 21:10 ./<br />drwxr-xr-x 3 root root 4096 Sep 29 20:09 ../<br />-rwxr-xr-x 1 root root 2167 Sep 29 17:21 ixp-manager-check-switch.sh*<br />-rwxr-xr-x 1 root root 2334 Sep 29 17:22 nagios-global-vars.sh*<br />-rwxr-xr-x 1 root root 1354 Sep 29 17:45 nagios-service.sh*<br />-rwxr-xr-x 1 root root  156 May 15 01:58 README.md*<br />-rwxr-xr-x 1 root root 3358 May 15 01:58 update-nagios-birdseye-daemons.sh*<br />-rwxr-xr-x 1 root root 4020 May 15 01:58 update-nagios-birdseye-sessions.sh*<br />-rwxr-xr-x 1 root root 3488 May 15 01:58 update-nagios-customers.sh*<br />-rwxr-xr-x 1 root root 8119 May 15 01:58 update-nagios.sh*<br />-rwxr-xr-x 1 root root 3085 May 15 01:58 update-nagios-switches.sh*<br /><br /><span style="font-size:20px;"><strong>root@agios:/srv/nagios# cat nagios-global-vars.sh</strong></span><br />#! /usr/bin/env bash<br />#<br /># Copyright (C) 2009 - 2019 Internet Neutral Exchange Association Company Limited By Guarantee.<br /># All Rights Reserved.<br />#<br /># This file is part of IXP Manager.<br />#<br /># IXP Manager is free software: you can redistribute it and/or modify it<br /># under the terms of the GNU General Public License as published by the Free<br /># Software Foundation, version 2.0 of the License.<br />#<br /># IXP Manager is distributed in the hope that it will be useful, but WITHOUT<br /># ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or<br /># FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for<br /># more details.<br />#<br /># You should have received a copy of the GNU General Public License v2.0<br /># along with IXP Manager.  If not, see:<br />#<br /># http://www.gnu.org/licenses/gpl-2.0.html<br />#<br /># Denis Nolan <denis.nolan -at- inex.ie>, July 2017<br /># Barry O'Donovan <barry.odonovan -at- inex.ie><br /><br /># Example script for updating Nagios target configuration from IXP Manager<br /><br /># See: http://docs.ixpmanager.org/features/nagios/<br /><br />## SET THE FOLLOWING VARIABLES APPROPRIATELY<br /><br />KEY="QJdu6J2GLnjGonoIYjxLfcAERFTCeX1j5VdAWAM5UM02rx1v"<br />URL="http://192.168.1.202/api/v4/nagios"<br /><br /># where to store the Nagios host/service configuration files:<br />#CONFPATH="/usr/local/etc/nagios/conf.d"<br />CONFPATH="/usr/local/nagios/etc/servers"<br /><br /># Main Nagios configuration file:<br />#NAGIOSCONF="/etc/nagios/nagios.cfg"<br />NAGIOSCONF="/usr/local/nagios/etc/nagios.cfg"<br /><br /># nagios binary:<br />#NAGIOS="/usr/local/bin/nagios"<br />NAGIOS="/usr/local/nagios/bin/nagios"<br /><br /># Command to make Nagios reload its configuration:<br />#NAGIOS_RELOAD="/usr/local/etc/rc.d/nagios reload"<br />NAGIOS_RELOAD="/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg"<br /><br /># List of infrastructure IDs to create switch targets for:<br /># INFRA="1 2"<br />INFRA="1"<br /><br /># List of VLANs to generate customer reachability / host targets for<br /># VLANS="1 2"<br />VLANS="1"<br /><br /># List IP protocols:<br />#PROTOCOLS="4 6"<br />PROTOCOLS="4"<br /><br /># BIRDTYPE: 1 = route servers | 2 = route collectors | 3 = as112<br /># To create BGP session checks for all routers, set this to:<br /># BIRDTYPE="1 2 3"<br />BIRDTYPE="1"<br /><br /># BIRDTEMPLATE: set to name of custom template name, otherwise leave<br /># as default<br />BIRDTEMPLATE="default"<br /><br />### END "SET THE FOLLOWING VARIABLES APPROPRIATELY" ###<br /><br /># SCRIPTPATH - to ensure scripts are always run in the same directory<br />SCRIPTPATH=$PWD<br />root@agios:/srv/nagios#<br /><br /><span style="font-size:16px;"><strong>root@agios:/srv/nagios# cat ixp-manager-check-switch.sh</strong></span><br />#! /usr/bin/env bash<br />#<br /># See: http://docs.ixpmanager.org/features/nagios/<br /><br /># Parse arguments<br />APIKEY="QJdu6J2GLnjGonoIYjxLfcAERFTCeX1j5VdAWAM5UM02rx1v"<br />URL="http://192.168.1.202/"<br />DEBUG=0<br />ID="1"<br /><br />usage() { echo "Usage: $0 -k <apikey> -i <switch-db-id> -u <ixp-manager-base-url> [-d]" 1>&2; exit 1; }<br /><br />hash jq   2>/dev/null || { echo >&2 "I require jq but it's not installed.  Aborting."; exit 1; }<br />hash wget 2>/dev/null || { echo >&2 "I require wget but it's not installed.  Aborting."; exit 1; }<br /><br />while getopts ":k:i:u:d" o; do<br />    case "${o}" in<br />        k)<br />            APIKEY=${OPTARG}<br />            ;;<br />        i)<br />            ID=${OPTARG}<br />            ;;<br />        u)<br />            URL=${OPTARG}<br />            ;;<br />        d)<br />            DEBUG=1<br />            ;;<br />        *)<br />            usage<br />            ;;<br />    esac<br />done<br />shift $((OPTIND-1))<br /><br />if [ -z "${APIKEY}" ] || [ -z "${ID}" ]; then<br />    usage<br />fi<br /><br /><br />STATUS="$( wget -O - -q  "${URL}/api/v4/switch/${ID}/status?apikey=${APIKEY}" )"<br /><br />if [ $? -ne 0 ] || [ -z "$STATUS" ]; then<br />    echo Could not query switch status via API<br />    exit 3<br />fi<br /><br />if [ "X`echo $STATUS | jq .status`X" = "XtrueX" ]; then<br />    RETCODE=0;<br />else<br />    RETCODE=2;<br />fi<br /><br />while read line; do<br />    echo -n "${line} "<br />done< <(echo $STATUS | jq -r '.msgs[]')<br /><br />echo<br /><br />exit $RETCODE<br /><br />root@agios:/srv/nagios#<br /><br /><span style="font-size:16px;"><strong>root@agios:/srv/nagios# cat nagios-service.sh</strong></span><br />#! /usr/bin/env bash<br />#<br /><br /># Example script for updating Nagios target configuration from IXP Manager<br /><br /># See: http://docs.ixpmanager.org/features/nagios/<br /><br />if [[ $RELOAD -eq 1 ]]; then<br />    if [ $DEBUG -ne 0 ]; then<br />        echo "Nagios reloading..."<br />        $NAGIOS -v $NAGIOSCONF && $NAGIOS_RELOAD<br />    else<br />        $NAGIOS -v >/dev/null && $NAGIOS_RELOAD &>/dev/null 2>&1<br />    fi<br />else<br />    if [ $DEBUG -ne 0 ]; then<br />        echo "Nagios not reloading as no reload scheduled."<br />    fi<br />fi<br /><br />exit 0<br />root@agios:/srv/nagios#<br /><br /><span style="font-size:16px;"><strong>root@agios:/srv/nagios# ./nagios-service.sh</strong></span><br />./nagios-service.sh: line 37: [: -ne: unary operator expected              <strong><span style="font-size:16px;">---------------------> there is problem</span></strong><br />root@agios:/srv/nagios#<br /><br /><span style="font-size:16px;"><strong>root@agios:/usr/local/nagios/etc/servers# ll</strong></span><br />total 32<br />drwxr-xr-x 2 root   root   4096 Sep 29 21:37 ./<br />drwxrwxr-x 4 nagios nagios 4096 Sep 29 21:03 ../<br />-rw-r--r-- 1 root   root   3007 Sep 29 21:13 birdseye-daemon-vlan1.cfg<br />-rw-r--r-- 1 root   root   5253 Sep 29 21:13 birdseye-sessions-vlan1-type-1-IPv4.cfg<br />-rw-r--r-- 1 root   root   7917 Sep 29 21:14 customers-vlan1-ipv4.cfg<br />-rw-r--r-- 1 root   root   3722 Sep 29 21:14 switches-infraid-1.cfg<br /><br /><strong><span style="font-size:16px;">I am not install NRPE Plugin at ixp manager or route server .</span></strong><br /><br /><span style="font-size:16px;"><strong>but after that the service stop and can't restart  ,why???<br /><br />root@agios:/usr/local/nagios/etc# systemctl restart nagios.service</strong></span><br />Job for nagios.service failed because the control process exited with error code.<br />See "systemctl status nagios.service" and "journalctl -xe" for details.<br /><br /><span style="font-size:16px;"><strong>root@agios:/usr/local/nagios/etc# systemctl status nagios.service</strong></span><br />● nagios.service - Nagios Core 4.4.6<br />     Loaded: loaded (/lib/systemd/system/nagios.service; enabled; vendor preset: enabled)<br />     Active: failed (Result: exit-code) since Tue 2020-09-29 22:11:28 UTC; 16s ago<br />       Docs: https://www.nagios.org/documentation<br />    Process: 10876 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (code=exited, status=1/FAILURE)<br />    Process: 10884 ExecStopPost=/usr/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd (code=exited, status=0/SUCCESS)<br /><br />Sep 29 22:11:28 agios nagios[10876]: ***> One or more problems was encountered while processing the config files...<br />Sep 29 22:11:28 agios nagios[10876]:      Check your configuration file(s) to ensure that they contain valid<br />Sep 29 22:11:28 agios nagios[10876]:      directives and data definitions.  If you are upgrading from a previous<br />Sep 29 22:11:28 agios nagios[10876]:      version of Nagios, you should be aware that some variables/definitions<br />Sep 29 22:11:28 agios nagios[10876]:      may have been removed or modified in this version.  Make sure to read<br />Sep 29 22:11:28 agios nagios[10876]:      the HTML documentation regarding the config files, as well as the<br />Sep 29 22:11:28 agios nagios[10876]:      'Whats New' section to find out what has changed.<br />Sep 29 22:11:28 agios systemd[1]: nagios.service: Control process exited, code=exited, status=1/FAILURE<br />Sep 29 22:11:28 agios systemd[1]: nagios.service: Failed with result 'exit-code'.<br />Sep 29 22:11:28 agios systemd[1]: Failed to start Nagios Core 4.4.6.<br /><br /><span style="font-size:16px;"><strong>root@agios:/usr/local/nagios/etc# journalctl -xe</strong></span><br />-- An ExecStartPre= process belonging to unit nagios.service has exited.<br />-<br />-- The process' exit code is 'exited' and its exit status is 1.<br />Sep 29 22:11:28 agios systemd[1]: nagios.service: Failed with result 'exit-code'.<br />-- Subject: Unit failed<br />-- Defined-By: systemd<br />-- Support: http://www.ubuntu.com/support<br />--<br />-- The unit nagios.service has entered the 'failed' state with result 'exit-code'.<br />Sep 29 22:11:28 agios systemd[1]: Failed to start Nagios Core 4.4.6.<br />-- Subject: A start job for unit nagios.service has failed<br />-- Defined-By: systemd<br />-- Support: http://www.ubuntu.com/support<br />--<br />-- A start job for unit nagios.service has finished with a failure.<br />--<br />-- The job identifier is 2530 and the job result is failed.<br />Sep 29 22:11:29 agios multipathd[706]: sda: add missing path<br />Sep 29 22:11:29 agios multipathd[706]: sda: failed to get udev uid: Invalid argument<br />Sep 29 22:11:29 agios multipathd[706]: sda: failed to get sysfs uid: Invalid argument<br />Sep 29 22:11:29 agios multipathd[706]: sda: failed to get sgio uid: No such file or directory<br />Sep 29 22:11:34 agios multipathd[706]: sda: add missing path<br />Sep 29 22:11:34 agios multipathd[706]: sda: failed to get udev uid: Invalid argument<br />Sep 29 22:11:34 agios multipathd[706]: sda: failed to get sysfs uid: Invalid argument<br />Sep 29 22:11:34 agios multipathd[706]: sda: failed to get sgio uid: No such file or directory<br />Sep 29 22:11:44 agios multipathd[706]: sda: add missing path<br />Sep 29 22:11:44 agios multipathd[706]: sda: failed to get udev uid: Invalid argument<br />Sep 29 22:11:44 agios multipathd[706]: sda: failed to get sysfs uid: Invalid argument<br />Sep 29 22:11:44 agios multipathd[706]: sda: failed to get sgio uid: No such file or directory<br />Sep 29 22:11:49 agios multipathd[706]: sda: add missing path<br />Sep 29 22:11:49 agios multipathd[706]: sda: failed to get udev uid: Invalid argument<br />Sep 29 22:11:49 agios multipathd[706]: sda: failed to get sysfs uid: Invalid argument<br />Sep 29 22:11:49 agios multipathd[706]: sda: failed to get sgio uid: No such file or directory<br />Sep 29 22:11:54 agios multipathd[706]: sda: add missing path<br />Sep 29 22:11:55 agios multipathd[706]: sda: failed to get udev uid: Invalid argument<br />Sep 29 22:11:55 agios multipathd[706]: sda: failed to get sysfs uid: Invalid argument<br />Sep 29 22:11:55 agios multipathd[706]: sda: failed to get sgio uid: No such file or directory<br />root@agios:/usr/local/nagios/etc#<br /><br /><span style="font-size:18px;"><strong>Where is the problem?</strong></span><br />--<br />Eng.Basil Elbalaawi <br />QOS Department - Complaints Unit<br dir="auto" />bbalaawi@mtit.gov.ps <br dir="auto" />SecdepBasil@yahoo.com<br dir="auto" />Jawwal 0599409108<br dir="auto" />Wataniay 0562504972</html>