Nethence Documentation Lab Webmail Your IP BBDock  


Those documents are obsolete, please use the Nethence Documentation instead.

HomeUnixWindowsOracleObsoleteHardwareDIYMechanicsScriptsConfigsPrivate

Turning NetBSD into the simplest but full-featured monitoring system ever
 
Setting up Clusterit
See http://pbraun.nethence.com/unix/sysutils/clusterit.html
 
Monitoring scripts
We are using Bash instead of KSH because the latter is not always installed on the target linux hosts.
 
We are just reporting errors (e.g. disk usage above 90%) so it get's send by email from a crontab.
 
Prepare the script,
mkdir ~/report/
cd ~/report/
wget http://pbraun.nethence.com/scripts/net/diskusage.bash
wget http://pbraun.nethence.com/scripts/net/memoryusage.bash
wget http://pbraun.nethence.com/scripts/net/omreport.bash
chmod +x diskusage.bash
chmod +x memoryusage.bash
chmod +x omreport.bash
test it,
cd ~/
dsh -e -g linux -s report/diskusage.bash
dsh -e -g linux -s report/memoryusage.bash
dsh -e -g poweredge -s report/omreport.bash
 
Enabling the crontab
1/ make sure you've setup the root alias in /etc/mail/aliases
2/ eventually setup a smarthost (relayhost =) into /etc/postfix/main.cf
3/ enable the crontab e.g.,
crontab -e
*/5 * * * * /usr/pkg/bin/dsh -e -g linux -s /root/report/diskusage.bash
0 * * * * /usr/pkg/bin/dsh -e -g poweredge -s /root/report/omreport.bash
also change the daily/weekly/monthly crontabs so you won't get bugged (no need to setup a filter which would make the alerts useless!),
15 3 * * * /bin/sh /etc/daily >> /var/log/daily.out 2>&1
30 4 * * 6 /bin/sh /etc/weekly >> /var/log/weekly.out 2>&1
30 5 1 * * /bin/sh /etc/monthly >> /var/log/monthly.out 2>&1
Note. full path for script to be executed is needed into the crontab, while on command line you can use -s report/scriptname where ever you are (so it's not even relative to your current working directory but to the homedir), strange.
 
Enabling the Web UI
Launch the NetBSD built-in web server (Bozohttpd),
cd /etc/
cp inetd.conf inetd.conf.dist
vi inetd.conf
http stream tcp nowait:600 _httpd /usr/libexec/httpd httpd -X /var/www
http stream tcp6 nowait:600 _httpd /usr/libexec/httpd httpd -X /var/www
/etc/rc.d/inetd reload
Note. -X to enable directory listing

Last update: Apr 12, 2016