KWh meter setup: verschil tussen versies
(18 tussenliggende versies door 3 gebruikers niet weergegeven) | |||
Regel 1: | Regel 1: | ||
− | + | [[Category:Servers network & websites]] | |
− | + | The remote access to the [[KWh meter]] depends on Wireguard[[Server setup| Wireguard]] and the kWh meter having a fixed IP. | |
+ | |||
+ | * IP address: 192.168.6.111 | ||
+ | * Port: 161 (snmp) | ||
+ | * Protocol: SNMPv2 public/community string standard | ||
+ | |||
+ | = MRTG setup = | ||
+ | |||
+ | This should be fixed - i.e. not run as root !! | ||
[Unit] | [Unit] | ||
− | Description= | + | Description=Multi-router Traffic Grapher |
− | After= | + | After=syslog.target |
− | + | ||
[Service] | [Service] | ||
− | ExecStart=/usr/bin/ | + | Environment=LANG=C |
− | + | ExecStart=/usr/bin/mrtg --daemon | |
− | + | Type=forking | |
− | + | SuccessExitStatus=0 1 | |
− | + | ||
[Install] | [Install] | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
− | + | Config file: | |
+ | |||
+ | # This file is for use with mrtg-2.5.4c | ||
+ | WorkDir: /var/www/mrtg | ||
+ | WriteExpires: Yes | ||
+ | |||
+ | Title[L1]: Phase 1 power | ||
+ | PageTop[L1]: <H1>L1</H1> | ||
+ | Target[L1]: 1.3.6.1.4.1.31034.2.8.1.5.1&1.3.6.1.4.1.31034.2.8.1.5.1:public@IPKWHMETER:161 | ||
+ | MaxBytes[L1]: 50000 | ||
+ | YLegend[L1]: Ampere | ||
+ | ShortLegend[L1]: A | ||
+ | Options[L1]: gauge,nopercent,noo | ||
+ | Factor[L1]: 0.01 | ||
+ | YTicsFactor[L1]: 0.01 | ||
+ | |||
+ | Title[L2]: Phase 2 power | ||
+ | PageTop[L2]: <H1>L2</H1> | ||
+ | Target[L2]: 1.3.6.1.4.1.31034.2.8.1.5.2&1.3.6.1.4.1.31034.2.8.1.5.2:public@IPKWHMETER:161 | ||
+ | MaxBytes[L2]: 50000 | ||
+ | YLegend[L2]: Ampere | ||
+ | ShortLegend[L2]: A | ||
+ | Options[L2]: gauge,nopercent,noo | ||
+ | Factor[L2]: 0.01 | ||
+ | YTicsFactor[L2]: 0.01 | ||
+ | |||
+ | Title[L3]: Phase 3 power | ||
+ | PageTop[L3]: <H1>L3</H1> | ||
+ | Target[L3]: 1.3.6.1.4.1.31034.2.8.1.5.3&1.3.6.1.4.1.31034.2.8.1.5.3:public@IPKWHMETER:161 | ||
+ | MaxBytes[L3]: 50000 | ||
+ | YLegend[L3]: Ampere | ||
+ | ShortLegend[L3]: A | ||
+ | Options[L3]: gauge,nopercent,noo | ||
+ | Factor[L3]: 0.01 | ||
+ | YTicsFactor[L3]: 0.01 | ||
+ | |||
+ | Title[Power]: Power | ||
+ | PageTop[Power]: <H1>Power</H1> | ||
+ | Target[Power]: 1.3.6.1.4.1.31034.2.8.1.5.1&1.3.6.1.4.1.31034.2.8.1.5.1:public@IPKWHMETER:161 + 1.3.6.1.4.1.31034.2.8.1.5.2&1.3.6.1.4.1.31034.2.8.1.5.2:public@IPKWHMETER:161 + 1.3.6.1.4.1.31034.2.8.1.5.3&1.3.6.1.4.1.31034.2.8.1.5.3:public@IPKWHMETER:161 | ||
+ | MaxBytes[Power]: 200000 | ||
+ | YLegend[Power]: Ampere | ||
+ | ShortLegend[Power]: A | ||
+ | Options[Power]: gauge,nopercent,noo | ||
+ | Factor[Power]: 0.01 | ||
+ | YTicsFactor[Power]: 0.01 | ||
+ | |||
+ | Webserver config in ```/etc/apache2/sites-enabled/mrtg.conf``` | ||
− | + | Alias /mrtg /var/www/mrtg | |
+ | |||
+ | DirectoryIndex index.html | ||
+ | <Directory /var/www/mrtg> | ||
+ | Options All +Indexes | ||
+ | order deny,allow | ||
+ | allow from all | ||
+ | Require all granted | ||
+ | </Directory> |
Huidige versie van 26 mrt 2025 om 17:02
The remote access to the KWh meter depends on Wireguard Wireguard and the kWh meter having a fixed IP.
- IP address: 192.168.6.111
- Port: 161 (snmp)
- Protocol: SNMPv2 public/community string standard
MRTG setup
This should be fixed - i.e. not run as root !!
[Unit] Description=Multi-router Traffic Grapher After=syslog.target
[Service] Environment=LANG=C ExecStart=/usr/bin/mrtg --daemon Type=forking SuccessExitStatus=0 1
[Install] WantedBy=multi-user.target
Config file:
# This file is for use with mrtg-2.5.4c WorkDir: /var/www/mrtg WriteExpires: Yes Title[L1]: Phase 1 power PageTop[L1]: <H1>L1</H1> Target[L1]: 1.3.6.1.4.1.31034.2.8.1.5.1&1.3.6.1.4.1.31034.2.8.1.5.1:public@IPKWHMETER:161 MaxBytes[L1]: 50000 YLegend[L1]: Ampere ShortLegend[L1]: A Options[L1]: gauge,nopercent,noo Factor[L1]: 0.01 YTicsFactor[L1]: 0.01 Title[L2]: Phase 2 power PageTop[L2]: <H1>L2</H1> Target[L2]: 1.3.6.1.4.1.31034.2.8.1.5.2&1.3.6.1.4.1.31034.2.8.1.5.2:public@IPKWHMETER:161 MaxBytes[L2]: 50000 YLegend[L2]: Ampere ShortLegend[L2]: A Options[L2]: gauge,nopercent,noo Factor[L2]: 0.01 YTicsFactor[L2]: 0.01 Title[L3]: Phase 3 power PageTop[L3]: <H1>L3</H1> Target[L3]: 1.3.6.1.4.1.31034.2.8.1.5.3&1.3.6.1.4.1.31034.2.8.1.5.3:public@IPKWHMETER:161 MaxBytes[L3]: 50000 YLegend[L3]: Ampere ShortLegend[L3]: A Options[L3]: gauge,nopercent,noo Factor[L3]: 0.01 YTicsFactor[L3]: 0.01 Title[Power]: Power PageTop[Power]: <H1>Power</H1> Target[Power]: 1.3.6.1.4.1.31034.2.8.1.5.1&1.3.6.1.4.1.31034.2.8.1.5.1:public@IPKWHMETER:161 + 1.3.6.1.4.1.31034.2.8.1.5.2&1.3.6.1.4.1.31034.2.8.1.5.2:public@IPKWHMETER:161 + 1.3.6.1.4.1.31034.2.8.1.5.3&1.3.6.1.4.1.31034.2.8.1.5.3:public@IPKWHMETER:161 MaxBytes[Power]: 200000 YLegend[Power]: Ampere ShortLegend[Power]: A Options[Power]: gauge,nopercent,noo Factor[Power]: 0.01 YTicsFactor[Power]: 0.01
Webserver config in ```/etc/apache2/sites-enabled/mrtg.conf```
Alias /mrtg /var/www/mrtg DirectoryIndex index.html <Directory /var/www/mrtg> Options All +Indexes order deny,allow allow from all Require all granted </Directory>