What's new

Entware Nagios

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

pepbrow

New Around Here
Update:
When I run the command to start Nagios (/opt/bin/nagios /opt/etc/nagios/nagios.cfg), it seems to hang:
Website: http://www.nagios.org
Nagios 3.5.1 starting... (PID=19809)
Local time is Mon Dec 21 08:38:31 GMT 2020

I attempt to access via browser (localhost or 192.168.1.1/nagios and nagiosadmin), "No such file or directory"

When I run Nagios start command using -v:
Total Warnings: 0
Total Errors: 0

Log:
[1608569985] Nagios 3.5.1 starting... (PID=30735)
[1608569985] Local time is Mon Dec 21 08:59:45 GMT 2020
[1608569985] LOG VERSION: 2.0
[1608570035] HOST NOTIFICATION: nagiosadmin;localhost;DOWN;notify-host-by-email;/bin/ping -w 30 -c 5 127.0.0.1
[1608570035] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\nHost: localhost\nState: DOWN\nAddress: 127.0.0.1\nInfo: /bin/ping -w 30 -c 5 127.0.0.1\n\nDate/Time: Mon Dec 21 09:00:35 GMT 2020\n" | /usr/bin/mail -s "** PROBLEM Host Alert: localhost is DOWN **" root@localhost" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...

any suggestions...
pepbrow Posts: 1Joined: Mon Dec 21, 2020 7:27 am
Top
 
Last edited:
When I run the command to start Nagios (/opt/bin/nagios /opt/etc/nagios/nagios.cfg), it seems to hang:
Website: http://www.nagios.org
Nagios 3.5.1 starting... (PID=19809)
Local time is Mon Dec 21 08:38:31 GMT 2020

I attempt to access via browser (localhost or 192.168.1.1/nagios and nagiosadmin), "No such file or directory"

When I run Nagios start command using -v:
Total Warnings: 0
Total Errors: 0

Log:
[1608569985] Nagios 3.5.1 starting... (PID=30735)
[1608569985] Local time is Mon Dec 21 08:59:45 GMT 2020
[1608569985] LOG VERSION: 2.0
[1608570035] HOST NOTIFICATION: nagiosadmin;localhost;DOWN;notify-host-by-email;/bin/ping -w 30 -c 5 127.0.0.1
[1608570035] Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\nHost: localhost\nState: DOWN\nAddress: 127.0.0.1\nInfo: /bin/ping -w 30 -c 5 127.0.0.1\n\nDate/Time: Mon Dec 21 09:00:35 GMT 2020\n" | /usr/bin/mail -s "** PROBLEM Host Alert: localhost is DOWN **" root@localhost" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...

pepbrow Posts: 1Joined: Mon Dec 21, 2020 7:27 am
Top
 
Wouldn't nagios be way too heavy to run on a router??

Anyways, I do notice one thing that is wrong: you attempt to go to 192.168.1.1/nagios.
Normally the router GUI is already running on port 80 -> Nagios cannot run on the same port.

So at least you have to change the config of nagios so that it will listen on a different port.
(or hack the router configuration files, so that the router gui listens on a different port).
 
and btw the warning from nagios -> router ping command does not support the -w option, so it will give an error, letting nagios think that localhost (127.0.0.1) is unreachable.

Not sure if you can change Nagios to use ping without the -w option.

Also interesting to check: which $PATH is set when Nagios is started? i.e., if that $PATH would start with /opt/bin:/opt:sbin, would Nagios then use /opt/bin/ping ?? Or does it use hardcoded paths?
(perhaps try something like export PATH=/opt/bin:/opt/sbin:$PATH && /opt/bin/nagios -v )

Otherwise a different workaround -> edit the symlink /bin/ping so that it no longer points to busybox but to /opt/bin/busybox
But this is a dangerous workaround -> if some router scripts also rely on ping during boot, then these scripts might do unexpected things if the USB-stick with entware is missing or not yet mounted.
 
I appreciate the reply/input:)

I installed Nagios from the entware package manager on a Netgear R9000 running on Voxel firmware. There wasn't much to configure.

Tried (export PATH=/opt/bin:/opt/sbin:$PATH && /opt/bin/nagios -v) it didn't work.

I changed Nagios to "url_html_path=:8086", but is still isn't starting so not sure if it will work...

I've attached the nagios.cfg and commands.cfg files...

symlinks:
root@R9000:/$ ls -l /opt/*
lrwxrwxrwx 1 root root 25 Oct 20 01:33 /opt/bin -> /tmp/mnt/sdb0/entware/bin
lrwxrwxrwx 1 root root 25 Oct 20 01:33 /opt/etc -> /tmp/mnt/sdb0/entware/etc
-rw-r--r-- 1 root root 855 Dec 31 1969 /opt/filelist
lrwxrwxrwx 1 root root 26 Oct 20 01:33 /opt/home -> /tmp/mnt/sdb0/entware/home
lrwxrwxrwx 1 root root 25 Oct 20 01:33 /opt/lib -> /tmp/mnt/sdb0/entware/lib
lrwxrwxrwx 1 root root 26 Oct 20 01:33 /opt/root -> /tmp/mnt/sdb0/entware/root
lrwxrwxrwx 1 root root 26 Oct 20 01:33 /opt/sbin -> /tmp/mnt/sdb0/entware/sbin
lrwxrwxrwx 1 root root 27 Oct 20 01:33 /opt/share -> /tmp/mnt/sdb0/entware/share
lrwxrwxrwx 1 root root 25 Oct 20 01:33 /opt/tmp -> /tmp/mnt/sdb0/entware/tmp
lrwxrwxrwx 1 root root 25 Oct 20 01:33 /opt/usr -> /tmp/mnt/sdb0/entware/usr
lrwxrwxrwx 1 root root 25 Oct 20 01:33 /opt/var -> /tmp/mnt/sdb0/entware/var
-rw-r--r-- 1 root root 68 Dec 31 1969 /opt/version

/opt/kamoj:
drwxr-xr-x 4 root root 392 Dec 24 08:55 addons

/opt/leafp2p:
-rwxr-xr-x 1 root root 724864 Dec 31 1969 leafp2p

/opt/rcagent:
drwxr-xr-x 2 root root 232 Dec 31 1969 cgi
-rwxr-xr-x 1 root root 363140 Dec 31 1969 cgi_processor
-rwxr-xr-x 1 root root 39008 Dec 31 1969 downloader
-rwxr-xr-x 1 root root 11712 Dec 31 1969 nas_service
-rwxr-xr-x 1 root root 213716 Dec 31 1969 rcagentd
-rwxr-xr-x 1 root root 125 Dec 31 1969 run_server.sh
drwxr-xr-x 2 root root 576 Dec 31 1969 scripts

/opt/remote:
-rwxr-xr-x 1 root root 88048 Dec 31 1969 remote
-rwxr-xr-x 1 root root 21228 Dec 31 1969 run_remote

/opt/scripts:
-rwxr-xr-x 1 root root 124 Dec 9 07:39 firewall-start-bwusage.sh
-rwxr-xr-x 1 root root 128 Dec 9 07:45 firewall-start-wireguard_killswitch.sh

/opt/xagent:
drwxr-xr-x 2 root root 240 Dec 31 1969 certs
-rwxr-xr-x 1 root root 37512 Dec 31 1969 genie_handler
-rwxr-xr-x 1 root root 333 Dec 31 1969 run-xagent.sh
-rwxr-xr-x 1 root root 86080 Dec 31 1969 xagent
-rwxr-xr-x 1 root root 81968 Dec 31 1969 xagent_control
 

Attachments

  • commands.txt
    7.8 KB · Views: 153
  • Nagios.txt
    43.6 KB · Views: 111
I do not use Nagios and I never used it. But, as far as I understand, it requires some additional package(s) to access it by http. Such as webserver and (?) php - I am not sure. nginx or lighthttpd or appache or ... And most probably corresponding plugin of Nagios (nagios-plugins).

It is not so easy for me to help you and to realize your need and knowledge (e.g. I prefer and I use nginx + php7 for my own needs, I have to use nginx + appache2 + php5 for corporative need etc.)

What is your goal? There is the package netdata allowing to monitor your router. Much more easy to install and use. Maybe it is enough?


Voxel.
 
I do not use Nagios and I never used it. But, as far as I understand, it requires some additional package(s) to access it by http. Such as webserver and (?) php - I am not sure. nginx or lighthttpd or appache or ... And most probably corresponding plugin of Nagios (nagios-plugins).

It is not so easy for me to help you and to realize your need and knowledge (e.g. I prefer and I use nginx + php7 for my own needs, I have to use nginx + appache2 + php5 for corporative need etc.)

What is your goal? There is the package netdata allowing to monitor your router. Much more easy to install and use. Maybe it is enough?


Voxel.

Hello,

I appreciate the assist.

My intent is to use Nagios to monitor my home network. I've set it on a Raspi 4 successfully, and that may be the way I end up going, but as it is my home network (less than 150 devices), if I can get it configured on the in the R9000, that would be more convenient.

I am going to add an IoT VLAN, a lab VLAN, and a VLAN for all of the mobile devices, everything else will be on the main network. I'll set up a management VLAN and monitor everything from there.

I have 3 VLAN capable switches, 1 is a 10gb mikrotik connected to the R9000 10G port, and 2 netgear switches.

Setup:
R9000 10g port > mikrotik
MS510TX (2 10G ports, 2-5G ports, 2-2.5G ports, 4-1G ports) > Mikrotik > R9000
GS108TV2 > R9000

right now wifi is all R9000 (most of the IoT is wifi)

VLANs:
IoT (I may use 1 of the R9000 guest wifi VLAN)
Lab > GS108
Mobil devices > R9000 WIFI

The R9000 with your firmware, Kamoj add-on (which works very well with wireguard) and Entware will hopefully provide monitoring and security using Nagios and SNORT. I have a few days off and I want to get all of it set before I go back to work.

I'm pretty sure the R9000 VLAN/Bridging will work fine after I set up VLANs on the switches. I should be able to bridge the guest wifi. I have looked into the R9000 regular wifi yet, but I may just use an R7000 I for all wifi. I'm still mapping it out...

Thanks much, and Happy Holidays:)
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top