[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Cheshire Cat Computing • View topic - current value not displayed in graph

Cheshire Cat Computing

Software support and information
It is currently Wed Nov 12, 2025 1:31 am

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Jul 24, 2008 3:06 am 
Offline
User

Joined: Thu Jul 24, 2008 2:57 am
Posts: 4
As a learning tool I wrote my own perl program to output the temperature and what it currently feels like in the area I work from a local weather map.
The output appears to be working fine supplying mrtg the 4 lines of output as follows:

<command line> ck_temp.pl 22172
77
77
6/23/2008 9:14:21
Temp

I am getting what appears to be a valid graph although the current value in the graph always is displayed as 0.00 I also wrote a similar program that outputs humidity and dew point which also is experiencing the same issue.

I am currently using routers2cgi version 2.17 mrtg version 2.15.2 and rrd version 1.2.15
Any insight or debugging information would be appreciated. All of the other 20+ graphs of my equipment appear to work fine.

Thanks,

- Bill


Top
 Profile Send private message  
 
PostPosted: Thu Jul 24, 2008 1:43 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
Have you specified the 'gauge' option? Your plug-in is retrieving the data as an absolute value rather than as a counter. Make sure you have

Options[targetname]: gauge

specified in your MRTG configuration file, else MRTG will store the change in the value, which will result in usually zero...

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Fri Jul 25, 2008 2:21 am 
Offline
User

Joined: Thu Jul 24, 2008 2:57 am
Posts: 4
Correct I am using gauge.

I believe that I read somewhere that if the date timestamp passed to target is different then the current timestamp that this will result in a zero.
In otherwords if there is a delay in receiving the data it can result in a zero.

Enclosed is the full configuration.

-------- ck-temp.cfg

WorkDir: C:\inetpub\wwwroot\MRTG

### Global Defaults
# to get bits instead of bytes and graphs growing to the right
Options[_]: growright, bits

# to Run as Daemon
RunAsDaemon: yes

# START RDTOOL Add-ons -------------------------------------
# Modify Logfiles (*.log) to RRD format (*.rrd)
LogFormat: rrdtool
# RRD Executable (rrdtool.exe) location
PathAdd: e:\rrd\rrdtool\bin
# RRD Perl module (RRDs.pm) location
LibAdd: e:\rrd\rrdtool\bindings\perl-shared
# STOP RDTOOL Add-ons -------------------------------------#

EnableIPv6: no

### Explicit Defaults for routers.cgi
routers.cgi*Ignore: yes
routers.cgi*Icon: temp-sm.gif
routers.cgi*ShortDesc: Weather

Include: config\weather.cfg

-------- weather.cfg
Target[weather_1]: `E:\mrtg-2.15.2\bin\ck_temp.pl 22172`
MaxBytes[weather_1]: 200
Unscaled[weather_1]: dwym
YLegend[weather_1]: Temp/Feels Like
ShortLegend[weather_1]: ° F

WithPeak[weather_1]: ymwd
LegendI[weather_1]: Temp Outside
LegendO[weather_1]: Feels Like Outside
Legend1[weather_1]: Temp Outside
Legend2[weather_1]: Feels Like Outside
Options[weather_1]: gauge,nopercent,unknaszero
Title[weather_1]: Temperature for Triangle, Va.
PageTop[weather_1]: <H1>Temperature according to weather.com</H1>

Target[weather_2]: `E:\mrtg-2.15.2\bin\ck_humid.pl 22172`
MaxBytes[weather_2]: 100
Unscaled[weather_2]: dwym
YLegend[weather_2]: Humidity/Dew Point
ShortLegend[weather_2]: %

WithPeak[weather_2]: ymwd
LegendI[weather_2]: Humidity
LegendO[weather_2]: Dew Point
Legend1[weather_2]: Humidity
Legend2[weather_2]: Dew Point
Options[weather_2]: gauge,nopercent,unknaszero
Title[weather_2]: Humidity/Dew Point for Triangle, Va.
PageTop[weather_2]: <H1>Statistics according to weather.com</H1>


Top
 Profile Send private message  
 
PostPosted: Fri Jul 25, 2008 10:56 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
If you are running in RRD mode (you are) then the last 2 items (time and description ) coming from the plugin are actually ignored. Only the first two numbers are used. Time window normalisation is not so important here either as the values change only slightly.

I dont know why you have routers.cgi*Ignore:yes as this will make Routers2 completely ignore this file!

I see you're graphing in degF - you probably dont need it, but Routers2 has a special option, c2fi and c2fo to convert centigrade to fanerheit (as most SNMP thermometers produce values in degrees C or tenths of a degree C).


Your maxbytes is 200, so incoming values should be below this fine.

I notice you have 'unknaszero' specified. Probably your MRTG is retrieving unknowns, and because of this is storing zeros. My guess would be that you have some problem with running the script from within MRTG and it is failing - check the error log from your MRTG, or run MRTG interactively. Possibly you will need to specify the perl executable on the command line (perl.exe script.pl) rather than just the script. Check that you dont need to have different access permissions or PATH settings to run the script.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Sat Jul 26, 2008 1:56 am 
Offline
User

Joined: Thu Jul 24, 2008 2:57 am
Posts: 4
routers.cgi*Ignore:yes is in my initial globals config file. I keep all the actual config files in a sub directory called config and have the global file include the various config files.

The web page I am pulling from actually displays the values in Fahrenheit.

The daemon window isn't showing any errors, the log file doesn't show any errors. I removed the unknaszero (this was pulled from other code), stopped and restarted the script.

I am running under windows as an administrator so I don't believe it to be a permissions issue. If it was a path issue to perl I would think I would be getting some error message somewhere.

I'm not really sure what running interactively means under a windows environment.

I can remove the run as daemon option from the config file and from the command line run
perl mrtg --logging ck_temp.log ck_temp.cfg
and not see any errors nor do I see any output so I can only assume that script is returning a value and mrtg is accepting it.

- Bill


Top
 Profile Send private message  
 
PostPosted: Sun Jul 27, 2008 10:29 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
If you've removed the unknaszero option, then see if the graph now shows zeros or unknowns (Im guessing unknowns).

Check the log file for your MRTG process, and see what error messages are being logged. I think it is failing to successfully run your data collection script for some reason, but I don't know what without seeing the MRTG process logs.

'run interactively' means run from the command line without daemon mode so that you can see any generated errors.

There are sometimes differences between the access rights of MRTG when run as a daemon and the rights when run from the command line. The only way to track down this is to look at the logs. The Windows version can be set to log to the windows Application log, so check there for logs.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Tue Jul 29, 2008 1:51 am 
Offline
User

Joined: Thu Jul 24, 2008 2:57 am
Posts: 4
Finally back to checking on things and it appears that by removing unknaszero option fixed the issue. The current value is now being displayed in the graph. I am not sure why that would effect showing the current value though unless rrd is looking for values that contain decimals.

Thanks for the help.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group