[mrtg] How configure mrtg for negative data?

Виктор Белоус bvictor at belous.su
Wed Jan 13 14:38:53 CET 2016


Hi !

I try use mrtg for get temperature data in Celsius degree positive and 
negative. In positive all good, but negative is null. Ноw configure mrtg 
for negative degree?

My debug output

Belka/bvictor16:22:38/opt/mrtg$env LANG=C mrtg lpowernode.conf --debug 
"cfg,dir,base,tarp,snpo,fork,time,log"
--time: prog start Wed Jan 13 16:25:01 2016
--base: Creating Lockfiles lpowernode.conf_l,lpowernode.conf_l_21491
--base: Reading Config File: lpowernode.conf
--cfg: lpowernode.conf[1]: EnableIPv6:  no
--cfg: lpowernode.conf[2]: options[_]:  bits
--cfg: lpowernode.conf[3]: workdir:     /var/www/mrtg
--cfg: lpowernode.conf[4]: Language:    russian
--cfg: lpowernode.conf[5]: IconDir:     /var/www/mrtg/icons
--cfg: lpowernode.conf[6]: SingleRequest:       Yes
--cfg: lpowernode.conf[7]: ################################
--cfg: lpowernode.conf[8]: # temperature 1
--cfg: lpowernode.conf[9]: ################################
--cfg: lpowernode.conf[10]: Target[lpowernode1]: 
1.3.6.1.4.1.47096.1.1.1.1.1.1.4.0&1.3.6.1.4.1.47096.1.1.1.1.1.1.4.1:belous at lpowernode1
--cfg: lpowernode.conf[11]: SetEnv[lpowernode1]: MRTG_INT_IP="" 
MRTG_INT_DESCR="Temperature 1"
--cfg: lpowernode.conf[12]: Directory[lpowernode1]: lpowernode1
--cfg: lpowernode.conf[13]: MaxBytes[lpowernode1]: 1000
--cfg: lpowernode.conf[14]: ShortLegend[lpowernode1]:   grad
--cfg: lpowernode.conf[15]: Title[lpowernode1]: Temperature 1
--cfg: lpowernode.conf[16]: WithPeak[lpowernode1]:              ym
--cfg: lpowernode.conf[17]: #XSize[Temp1]: 600
--cfg: lpowernode.conf[18]: #YSize[Temp1]: 300
--cfg: lpowernode.conf[19]: PageTop[lpowernode1]: <H1>Temperature 1</H1>
--cfg: lpowernode.conf[20]: Options[lpowernode1]: gauge, nopercent, 
absolute, expscale
--cfg: lpowernode.conf[21]: YLegend[lpowernode1]: Temp
--cfg: lpowernode.conf[22]: #YScale[lpowernode1]: 0.1
--cfg: lpowernode.conf[23]: Factor[lpowernode1]: 0.1
--cfg: lpowernode.conf[24]: Legend1[lpowernode1]: Temp 1
--cfg: lpowernode.conf[25]: Legend2[lpowernode1]: Temp 2
--cfg: lpowernode.conf[26]: Legend3[lpowernode1]: Max value per interval 
on graph
--cfg: lpowernode.conf[27]: Legend4[lpowernode1]:               .
--cfg: lpowernode.conf[28]: LegendI[lpowernode1]: Temperature 1
--cfg: lpowernode.conf[29]: LegendO[lpowernode1]: Temperature 2
--cfg: lpowernode.conf[30]:
--cfg: lpowernode.conf[31]: ################################
--cfg: lpowernode.conf[32]: # temperature 2
--cfg: lpowernode.conf[33]: ################################
--cfg: lpowernode.conf[34]: Target[lpowernode2]: 
1.3.6.1.4.1.47096.1.1.1.1.1.1.4.2&1.3.6.1.4.1.47096.1.1.1.1.1.1.4.3:belous at lpowernode1
--cfg: lpowernode.conf[35]: SetEnv[lpowernode2]: MRTG_INT_IP="" 
MRTG_INT_DESCR="Temperature 2"
--cfg: lpowernode.conf[36]: Directory[lpowernode2]: lpowernode1
--cfg: lpowernode.conf[37]: MaxBytes[lpowernode2]: 1000
--cfg: lpowernode.conf[38]: ShortLegend[lpowernode2]:   grad
--cfg: lpowernode.conf[39]: Title[lpowernode2]: Temperature 2
--cfg: lpowernode.conf[40]: WithPeak[lpowernode2]:              ym
--cfg: lpowernode.conf[41]: #XSize[Temp2]: 600
--cfg: lpowernode.conf[42]: #YSize[Temp2]: 300
--cfg: lpowernode.conf[43]: PageTop[lpowernode2]: <H1>Temperature 2</H1>
--cfg: lpowernode.conf[44]: Options[lpowernode2]: gauge, nopercent, 
absolute, expscale
--cfg: lpowernode.conf[45]: YLegend[lpowernode2]: Temp
--cfg: lpowernode.conf[46]: #YScale[lpowernode2]: 0.1
--cfg: lpowernode.conf[47]: Factor[lpowernode2]: 0.1
--cfg: lpowernode.conf[48]: Legend1[lpowernode2]: Temp 3
--cfg: lpowernode.conf[49]: Legend2[lpowernode2]: Temp 4
--cfg: lpowernode.conf[50]: Legend3[lpowernode2]: Max value per interval 
on graph
--cfg: lpowernode.conf[51]: Legend4[lpowernode2]:               .
--cfg: lpowernode.conf[52]: LegendI[lpowernode2]: Temperature 3
--cfg: lpowernode.conf[53]: LegendO[lpowernode2]: Temperature 4
--cfg: lpowernode.conf[54]:
--base: Reading Interface Config cache
--base: Checking Config File
--dir: ensure path IN:  '/var/www/mrtg'
--dir: ensure path OUT: '/var/www/mrtg/'
--dir: imagehtml =
--dir: ensure path IN:  'lpowernode1'
--dir: ensure path OUT: 'lpowernode1/'
--dir: directory for lpowernode1 'lpowernode1/'
--tarp: Starting lpowernode1 -> 
1.3.6.1.4.1.47096.1.1.1.1.1.1.4.0&1.3.6.1.4.1.47096.1.1.1.1.1.1.4.1:belous at lpowernode1
--tarp: &targparser external done: 
'1.3.6.1.4.1.47096.1.1.1.1.1.1.4.0&1.3.6.1.4.1.47096.1.1.1.1.1.1.4.1:belous at lpowernode1'
--tarp: New complex target [0] 
'1.3.6.1.4.1.47096.1.1.1.1.1.1.4.0&1.3.6.1.4.1.47096.1.1.1.1.1.1.4.1:belous at lpowernode1':
   Comu:  belous, Host: lpowernode1
   Opt:   , IPv4: 1
   Conv:
   OID:   1.3.6.1.4.1.47096.1.1.1.1.1.1.4, 1.3.6.1.4.1.47096.1.1.1.1.1.1.4
   IfSel: If, If
   Key:   0, 1
--tarp: &targparser complex done: ' $target->[0]{$mode} '
--tarp: &targparser simple done: ' $target->[0]{$mode} '
--tarp: &targparser returning: unique = 0
--dir: ensure path IN:  'lpowernode1'
--dir: ensure path OUT: 'lpowernode1/'
--dir: directory for lpowernode2 'lpowernode1/'
--tarp: Starting lpowernode2 -> 
1.3.6.1.4.1.47096.1.1.1.1.1.1.4.2&1.3.6.1.4.1.47096.1.1.1.1.1.1.4.3:belous at lpowernode1
--tarp: &targparser external done: 
'1.3.6.1.4.1.47096.1.1.1.1.1.1.4.2&1.3.6.1.4.1.47096.1.1.1.1.1.1.4.3:belous at lpowernode1'
--tarp: New complex target [1] 
'1.3.6.1.4.1.47096.1.1.1.1.1.1.4.2&1.3.6.1.4.1.47096.1.1.1.1.1.1.4.3:belous at lpowernode1':
   Comu:  belous, Host: lpowernode1
   Opt:   , IPv4: 1
   Conv:
   OID:   1.3.6.1.4.1.47096.1.1.1.1.1.1.4, 1.3.6.1.4.1.47096.1.1.1.1.1.1.4
   IfSel: If, If
   Key:   2, 3
--tarp: &targparser complex done: ' $target->[1]{$mode} '
--tarp: &targparser simple done: ' $target->[1]{$mode} '
--tarp: &targparser returning: unique = 1
--base: Loading Locale for russian
--base: Starting main Loop
--time: loop start Wed Jan 13 16:25:01 2016
--base: Populate Target object by polling SNMP and external Datasources
--time: snmp read start Wed Jan 13 16:25:01 2016
--snpo: run snmpget from 
1.3.6.1.4.1.47096.1.1.1.1.1.1.4&1.3.6.1.4.1.47096.1.1.1.1.1.1.4:belous at lpowernode1
--snpo: simple If: .0
--snpo: simple If: .1
--snpo: SNMPGet from belous at lpowernode1 -- 
1.3.6.1.4.1.47096.1.1.1.1.1.1.4.0,1.3.6.1.4.1.47096.1.1.1.1.1.1.4.1,sysUptime,sysName
--snpo: SNMPfound -- '518', '120', '6:36:41', 'INTELLECT-MODULE LPOWERNODE'
--snpo: run snmpget from 
1.3.6.1.4.1.47096.1.1.1.1.1.1.4&1.3.6.1.4.1.47096.1.1.1.1.1.1.4:belous at lpowernode1
--snpo: simple If: .2
--snpo: simple If: .3
--snpo: SNMPGet from belous at lpowernode1 -- 
1.3.6.1.4.1.47096.1.1.1.1.1.1.4.2,1.3.6.1.4.1.47096.1.1.1.1.1.1.4.3,sysUptime,sysName
--snpo: SNMPfound -- '-600', '-600', '6:36:41', 'INTELLECT-MODULE 
LPOWERNODE'
--time: target loop start Wed Jan 13 16:25:02 2016
--base: Act on Router/Target lpowernode1
--base: Get Current values: in:518, out:120, up:6:36:41, 
name:INTELLECT-MODULE LPOWERNODE, time:1452691501
--base: Create Graphics
--log: /opt/csw/bin/rateup /var/www/mrtg/lpowernode1/ lpowernode1 
1452691501 -Z g 518 120 1000 c #00cc00 #0000ff #006600 #ff00ff -x l 
[Temp] k 1000 i /var/www/mrtg/lpowernode1/lpowernode1-day.png -1000 
-1000 400 100 1 1 0 300 0 4 1 %Y-%m-%d %H:%M 0
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: Act on Router/Target lpowernode2
--base: Get Current values: in:-600, out:-600, up:6:36:41, 
name:INTELLECT-MODULE LPOWERNODE, time:1452691502
--base: Create Graphics
--log: /opt/csw/bin/rateup /var/www/mrtg/lpowernode1/ lpowernode2 
1452691502 -Z g 2147483048 2147483048 1000 c #00cc00 #0000ff #006600 
#ff00ff -x l [Temp] k 1000 i 
/var/www/mrtg/lpowernode1/lpowernode2-day.png -1000 -1000 400 100 1 1 0 
300 0 4 1 %Y-%m-%d %H:%M 0
--base: Check for Thresholds
--base: Check for Write HTML Pages
--base: End of main Loop
--base: Exit main Loop
--base: Remove Lock Files
--base: Store Interface Config Cache


Also snmp-walk output

Belka/bvictor16:25:02/opt/mrtg$snmpwalk -v 2c -c belous lpowernode1 
1.3.6.1.4.1.47096.1.1.1.1.1.1.4
SNMPv2-SMI::enterprises.47096.1.1.1.1.1.1.4.0 = INTEGER: 517
SNMPv2-SMI::enterprises.47096.1.1.1.1.1.1.4.1 = INTEGER: 118
SNMPv2-SMI::enterprises.47096.1.1.1.1.1.1.4.2 = INTEGER: -600
SNMPv2-SMI::enterprises.47096.1.1.1.1.1.1.4.3 = INTEGER: -600

-- 
С уважением,
Виктор Антонович Белоус
Корневой сертификат http://mail.belous.su/ca/belous.CA.der


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3177 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.oetiker.ch/pipermail/mrtg/attachments/20160113/ae997438/attachment.bin>


More information about the mrtg mailing list