Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: Reliability monitoring  (Read 2277 times)

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Reliability monitoring
« on: January 18, 2022, 04:45:30 AM »

I’m wondering if there exists a piece of software that I could install on my Raspberry Pi ARM64 linux machine which could monitor the status of various device using regular pings. This would ideally be like the f8lure.mouselike.org system but a local version. I could indeed use mouselike.org if I were to add various holes in the firewall for various IP addresses, set a srcaddr and pings-only conditions too. I’m not sure I can afford a Firebrick 6000 series pingbox for this job but that would be perfect.
Logged

adrianw

  • Reg Member
  • ***
  • Posts: 163
Re: Reliability monitoring
« Reply #1 on: January 18, 2022, 05:01:26 AM »

Something like using a steam hammer to crack a peanut, but Nagios Core would do the job and much more.
When I had a job, much of our monitoring was performed with Nagios.

https://pimylifeup.com/raspberry-pi-nagios/
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Reliability monitoring
« Reply #2 on: January 18, 2022, 08:11:25 AM »

Brilliant- thank you.

I’ve had some problems with the installation. Apache2 works and http://server_name/nagios produces a login prompt as expected but instead of a webpage rendered properly I just get a load of PHP source, so it’s as if Apache2 doesn’t understand PHP. I attempted to force a reinstall action if php 7.3 but that didn’t go well; there were lots of error messages something about <xxx> was not configured and ssl-cert failed. Mentioned a locking error; perhaps that’s because Apache is running while I’m trying to reinstall the ssl_cert module or something else to do with php or one of its dependencies.



Repeated the installation, got rid of the error messages this time by carefully redoing everything, afaik. But I’m still just seeing PHP source from Apache - my web browser does not seem to be getting a server-side PHP-rendered page, just as if Apache2 doesn’t understand PHP, as before.
« Last Edit: January 18, 2022, 08:50:10 AM by Weaver »
Logged

meritez

  • Content Team
  • Kitizen
  • *
  • Posts: 1625
Re: Reliability monitoring
« Reply #3 on: January 18, 2022, 09:01:57 AM »

Good Morning Weaver, that sounds like a permissions issue, did you install as root or as a normal user using sudo?
Logged

adrianw

  • Reg Member
  • ***
  • Posts: 163
Re: Reliability monitoring
« Reply #4 on: January 18, 2022, 10:26:55 AM »

I have just spent a few hours setting up Nagios on my FreeBSD VM. It did not go as smoothly as I expected, and the advice as to what is needed is scattered all over the place.

If you are in to yet another layer of software https://hub.docker.com/r/manios/nagios is a packaged Nagios Core with supported architectures: x86, amd64, arm/v6, arm/v7, arm64. This might be easier. Or might not.

Here is what I installed, with * marking explicit installs, the rest being dependencies. Note the definite need to install mod_php and possibly php gd.
The FreeBSD Nagios port maintainers did not want to make Nagios dependent upon Apache (other CGI supporting web servers may be available) so there are these gotchas.
The bits of the package names after the final "-" and the "php74-" prefixes are a feature of the FreeBSD pkg system.
Code: [Select]
apr-1.7.0.1.6.1_1
*apache24-2.4.52

 libargon2-20190702
 pcre2-10.39
 giflib-5.2.1
 php74-7.4.27
 webp-1.2.1
 php74-xml-7.4.27
 php74-filter-7.4.27
 nagios-plugins-2.3.3_2,1
 libgd-2.3.1,1
 libltdl-2.4.6
*nagios4-4.4.6_1,1

*mod_php74-7.4.27

*php74-gd-7.4.27

Here are the changes to my Apache configuration

Code: [Select]
[aw1@titus .../local/etc/apache24]$ diff -u httpd.conf.sample httpd.conf
--- httpd.conf.sample   2022-01-02 01:31:45.000000000 +0000
+++ httpd.conf  2022-01-18 08:19:00.218439000 +0000
@@ -163,10 +163,10 @@
 #LoadModule asis_module libexec/apache24/mod_asis.so
 #LoadModule info_module libexec/apache24/mod_info.so
 <IfModule !mpm_prefork_module>
-       #LoadModule cgid_module libexec/apache24/mod_cgid.so
+       LoadModule cgid_module libexec/apache24/mod_cgid.so
 </IfModule>
 <IfModule mpm_prefork_module>
-       #LoadModule cgi_module libexec/apache24/mod_cgi.so
+       LoadModule cgi_module libexec/apache24/mod_cgi.so
 </IfModule>
 #LoadModule dav_fs_module libexec/apache24/mod_dav_fs.so
 #LoadModule dav_lock_module libexec/apache24/mod_dav_lock.so
@@ -179,6 +179,7 @@
 #LoadModule userdir_module libexec/apache24/mod_userdir.so
 LoadModule alias_module libexec/apache24/mod_alias.so
 #LoadModule rewrite_module libexec/apache24/mod_rewrite.so
+LoadModule php7_module        libexec/apache24/libphp7.so

 # Third party modules
 IncludeOptional etc/apache24/modules.d/[0-9][0-9][0-9]_*.conf
@@ -214,7 +215,7 @@
 # e-mailed.  This address appears on some server-generated pages, such
 # as error documents.  e.g. admin@your-domain.com
 #
-ServerAdmin you@example.com
+ServerAdmin aw1

 #
 # ServerName gives the name and port that the server uses to identify itself.
@@ -281,7 +282,7 @@
 # is requested.
 #
 <IfModule dir_module>
-    DirectoryIndex index.html
+    DirectoryIndex index.html index.php
 </IfModule>

 #
@@ -535,4 +536,41 @@
 </IfModule>

 Include etc/apache24/Includes/*.conf
+
+# nagios
+<Directory /usr/local/www/nagios>
+#Require ip 127.0.0.1
+php_flag engine on
+php_admin_value open_basedir /usr/local/www/nagios/:/var/spool/nagios/
+Options None
+AllowOverride None
+Order allow,deny
+Allow from all
+AuthName   "Nagios Access"
+AuthType Basic
+AuthUSerFile /usr/local/etc/nagios/htpasswd.users
+Require valid-user
+</Directory>
+
+<Directory /usr/local/www/nagios/cgi-bin>
+Options ExecCGI
+AllowOverride None
+Order allow,deny
+Allow from all
+AuthName   "Nagios Access"
+AuthType Basic
+AuthUSerFile /usr/local/etc/nagios/htpasswd.users
+Require valid-user
+</Directory>
+
+ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/
+Alias /nagios/ /usr/local/www/nagios/
+
+# PHP
+<FilesMatch "\.php$">
+    SetHandler application/x-httpd-php
+</FilesMatch>
+<FilesMatch "\.phps$">
+    SetHandler application/x-httpd-php-source
+</FilesMatch>

Hope this helps.
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Reliability monitoring
« Reply #5 on: January 18, 2022, 06:59:11 PM »

> Good Morning Weaver, that sounds like a permissions issue, did you install as root or as a normal user using sudo?

Installed as root, without sudo.
I don’t know enough about apache2 to understand how it’s server-side parsing works, how it knows that php markers are supposed to be associated with php; php, which is <what>?
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Reliability monitoring
« Reply #6 on: January 18, 2022, 10:28:45 PM »

I tried repeating the installation yet again, and have now gone backwards - I no longer have a working apache2 ; systemctl status apache2 shows an error.

Basically I have no idea how to install apache2 reliably, and also I’m not sure those instructions are sufficiently robust, either that or there are bugs in the installers where they don’t take account of some problem situations.

So I’m basically screwed. Also I have made quite a mess which I don’t know how to clean up. Linux ease of use, give me back my WinNT!
« Last Edit: January 18, 2022, 11:00:20 PM by Weaver »
Logged

toulouse

  • Reg Member
  • ***
  • Posts: 595
  • I like cheesecake !!!
Re: Reliability monitoring
« Reply #7 on: January 18, 2022, 10:43:59 PM »

Hello Weaver (and others who may be interested),
If you want a good guide on installing apache2 on Raspberry Pi, you could do a lot worse than try 'PiMyLifeUp.com' where you will find all sorts of useful hints and tips including apache2 and all that it requires, i.e. php and various others.

toulouse
 
Logged
Utility Warehouse (via TalkTalk)
FTTC 40/10
ZyXEL VMG8924-B10A
ECI (approx 750 metres)

People tell me that I ought to get out more. But in the words of the great Homer J Simpson, "Yeah, but what ya gonna do ?"

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Reliability monitoring
« Reply #8 on: January 18, 2022, 10:53:10 PM »

Hi toulouse, am already reading article from pimylifeup. What I really need is a single reliable shell script that handles error conditions and previous brokenness.

Many thanks to all of you for your help. Nagios could be ideal if I can ever get Apache2 installed. (which I did successfully first time, showed the startup page as expected, just didn’t understand php.)

Please note: am running debian buster aarch64, not the old standard raspberry pi 32-bit arm o/s.
« Last Edit: January 18, 2022, 10:58:35 PM by Weaver »
Logged

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 7382
  • VM Gig1 - AAISP L2TP
Re: Reliability monitoring
« Reply #9 on: January 19, 2022, 01:32:21 AM »

I will take a look at my nagios installation tomorrow to see if it needs anything special in apache and report back here, it was so long ago it was setup, I cannot remember of hand the specifics.  But it is nagios from freebsd ports, and using apache web server.  What I cannot remember is if it needed a cgi configuration in apache which I will check.

When you guys do get it working, if you want convenient access, I recommend the anag app.
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Reliability monitoring
« Reply #10 on: January 19, 2022, 02:38:00 AM »

I’m thinking about getting a Raspberry Pi 4. What is the good AArch64 distro to put on it? - given that things have possibly moved on giving some more choice of ARM 64-bit operating systems?
Logged

adrianw

  • Reg Member
  • ***
  • Posts: 163
Re: Reliability monitoring
« Reply #11 on: January 19, 2022, 03:20:09 AM »

I will take a look at my nagios installation tomorrow to see if it needs anything special in apache and report back here, it was so long ago it was setup, I cannot remember of hand the specifics.  But it is nagios from freebsd ports, and using apache web server.  What I cannot remember is if it needed a cgi configuration in apache which I will check.

Setting up Apache with PHP for Nagios under FreeBSD needed quite a lot of manual additions to httpd.conf. Little was done by package installation. No idea what happens on a LINUX system.
See my earlier diffs.

When you guys do get it working, if you want convenient access, I recommend the anag app.
aNag does look interesting. Thanks!
Logged

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 7382
  • VM Gig1 - AAISP L2TP
Re: Reliability monitoring
« Reply #12 on: January 24, 2022, 03:29:20 PM »

I checked my config (rather grepped for nagios), and the only things there are basedir overrides as nagios has files in non standard www locations.
Logged
 

anything