Merge pull request #4 from w7ncx/main

Update README.md (#5)
This commit is contained in:
Waldek 2021-06-28 06:42:47 +02:00 committed by GitHub
commit 9d2c6a0207
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 25 deletions

View File

@ -43,7 +43,7 @@ php support running on the server.
The logo image you can replace with file image in html directory img/logo.png The logo image you can replace with file image in html directory img/logo.png
cp utils/lastheard /etc/cron.daily/ cp utils/lastheard /etc/cron.daily/
chmod +x /etc/cron.daily/lastherad chmod +x /etc/cron.daily/lastheard
cp utils/hbmon.service /lib/systemd/system/ cp utils/hbmon.service /lib/systemd/system/
systemctl enable hbmon systemctl enable hbmon
systemctl start hbmon systemctl start hbmon
@ -60,7 +60,7 @@ php support running on the server.
if int(float(p[9])) > 2: if int(float(p[9])) > 2:
If you want to have more than the last 15 entries in the Lastherad table If you want to have more than the last 15 entries in the Lastheard table
change in the monitor.py file line from: change in the monitor.py file line from:
# maximum number of lists in lastheard on the main page # maximum number of lists in lastheard on the main page

View File

@ -9,7 +9,7 @@ The ezSM you can download from: https://www.ezservermonitor.com/
mv ezservermonitor-web esm mv ezservermonitor-web esm
cd esm/conf/ cd esm/conf/
Edit file esm.config.json and read domunetation about configuration: https://www.ezservermonitor.com/esm-web/documentation Edit file esm.config.json and read documentation about configuration: https://www.ezservermonitor.com/esm-web/documentation
Edit file /var/www/html/buttons.html and change link from Edit file /var/www/html/buttons.html and change link from
<a href="sysinfo.php"><button class="button link">&nbsp;System Info&nbsp;</button></a> <a href="sysinfo.php"><button class="button link">&nbsp;System Info&nbsp;</button></a>
@ -54,7 +54,7 @@ Install package:
Change scripts to execute: Change scripts to execute:
chmod +x /opt/HBMonv2/sysinfo/cpu.sh chmod +x /opt/HBMonv2/sysinfo/cpu.sh
chmod +x /opt/HBMonv2/sysinfo/grap.sh chmod +x /opt/HBMonv2/sysinfo/graph.sh
chmod +x /opt/HBMonv2/sysinfo/rrd-db.sh chmod +x /opt/HBMonv2/sysinfo/rrd-db.sh
Run script create database Run script create database
@ -83,13 +83,7 @@ where is located your html files of HBMon
Setup temperature depend of your computer Setup temperature depend of your computer
On raspberry pi or PC you can use sensors package to get temperature CPU On raspberry pi or PC you can use sensors package to get temperature CPU
If not avilable set: If you don't want to show temperature on the Pi, comment out the line that gets the temp
tempcpu=false
For VPS set:
tempcpu=false
Optional display network traffic Optional display network traffic
=============================== ===============================
@ -123,9 +117,12 @@ Please edit /etc/mrtg.cfg and change diretory to store image change WorkDir with
path to your webserver html directory where is html files for HBMon: path to your webserver html directory where is html files for HBMon:
WorkDir:/var/www/html/hbmon/img/mrtg WorkDir:/var/www/html/hbmon/img/mrtg
or
WorkDir:/var/www/html/img/mrtg
Put below lines in section your network card
Put below lines in section your netrwork card
and replace localhost_2 to your name network card as result cfgmaker generate in mrtg.cfg and replace localhost_2 to your name network card as result cfgmaker generate in mrtg.cfg
XSize[localhost_2]: 600 XSize[localhost_2]: 600

View File

@ -7,26 +7,22 @@ WEB_PATH='/var/www/html/'
# Temperature CPU (not working for VPS) # Temperature CPU (not working for VPS)
# Disable = false or enable = true create graph fortemperature CPU
tempcpu=false
# Setup temperature for CPU ============ # Setup temperature for CPU ============
#For Raspberry PI:
#For Raspberry PI, comment next 4 lines if you don't want temperature:
FILE=/sys/class/thermal/thermal_zone0/temp FILE=/sys/class/thermal/thermal_zone0/temp
if [[ -f "$FILE" ]]; then if [[ -f "$FILE" ]]; then
tempC=`cat /sys/class/thermal/thermal_zone0/temp |awk '{printf("%.1f",$1)}'` tempC=`cat /sys/class/thermal/thermal_zone0/temp |awk '{printf("%.1f",$1/1000)}'`
fi fi
# For compuers not like Raspberry PI install package # For computers not like Raspberry PI install package
# at install lm-sensors # at install lm-sensors
# and run: sensors-detect # and run: sensors-detect
# after this check result run command: sensors to see temperature CPU, if no set above tempcpu=false # after this check result run command: sensors to see temperature CPU
# Remove when use for Raspberry PI (see above) if [ -z "$tempC" ] ; then
if $tempcpu == "True" ; then
tempC=`sensors | grep -i "Core 0" | grep "$1" | sed -re "s/.*:[^+]*?[+]([.0-9]+)[ °]C.*/\1/g"` tempC=`sensors | grep -i "Core 0" | grep "$1" | sed -re "s/.*:[^+]*?[+]([.0-9]+)[ °]C.*/\1/g"`
fi fi
@ -46,7 +42,7 @@ NOW=`date -u +%s`
# Update db ===================================================== # Update db =====================================================
if $tempcpu == "True" ; then if [ -n "$tempC" ] ; then
/usr/bin/rrdtool update /opt/HBMonv2/sysinfo/tempC.rrd $NOW:$tempC /usr/bin/rrdtool update /opt/HBMonv2/sysinfo/tempC.rrd $NOW:$tempC
fi fi
@ -57,7 +53,7 @@ fi
# Generate images ================================================================ # Generate images ================================================================
if $tempcpu == "True" ; then if [ -n "$tempC" ] ; then
# Temperature CPU # Temperature CPU
/usr/bin/rrdtool graph $WEB_PATH/img/tempC.png -t "Temperature CPU 24H - `/bin/date`" \ /usr/bin/rrdtool graph $WEB_PATH/img/tempC.png -t "Temperature CPU 24H - `/bin/date`" \
--rigid --alt-y-grid --alt-autoscale --units-exponent 0 \ --rigid --alt-y-grid --alt-autoscale --units-exponent 0 \