| Cheshire Cat Computing http://www.steveshipway.org/forum/ |
|
| What should the External Script return when unreachable? http://www.steveshipway.org/forum/viewtopic.php?f=11&t=4402 |
Page 1 of 1 |
| Author: | eddiechan [ Sat Aug 20, 2011 7:59 am ] |
| Post subject: | What should the External Script return when unreachable? |
I notice when the target device is unreachable, the graph's current value remain unchanged as same as the last read value, Resulting in a flat line in the graph. Is it an expected behavior in MRTG? I thought it would show an empty line producing a gap effect in the graph which I was hoping to see. I am not integrated to RRDTool, just plain MRTG version 2.16.2 on Ubuntu Server. I am using External Script to generate data, the script return correct value when the target is reachable (and the graph plots normally as expected). 13606672 53502192 uptime myrouter And I made my External Script returns "UNKNOWN" when the target is unreachable. It is when the graph's Current Value never change resulting in a flat line graph. Am I using the wrong value, should I return something different then "UNKNOWN"? UNKNOWN UNKNOWN UNKNOWN UNKNOWN And this is the config calling an External Script: (I have tried deleting the gauge option, same result) Options[myrouter]: growright, gauge Target[myrouter]: `/home/echan/fetch_data.pl 10.42.83.99 .1.3.6.1.4.1.9.9.48.1.1.1.5.2 .1.3.6.1.4.1.9.9.48.1.1.1.6.2` MaxBytes[myrouter]: 800000000 Title[myrouter]: Title2 PageTop[myrouter]: <H1>PageTop2</H1> Timezone[myrouter]: Japan MRTG returns following error when the target is unreachable which I believe is a expected behavior. ERROR: Target[myrouter][_IN_] ' $target->[3]{$mode} ' did not eval into defined data And I notice the latest value in the .log file is always -1 and it just keep copy over from the last known value. 1313779201 -1 -1 1313779201 6197316 6385596 6197316 6385596 1313778901 6197316 6385596 6197316 6385596 1313778900 6197316 6385596 6197316 6385596 Thanks. |
|
| Author: | stevesh [ Sat Aug 20, 2011 10:17 am ] |
| Post subject: | Re: What should the External Script return when unreachable? |
When the target is unreachable, you should return 'UNKNOWN'. Native-mode MRTG will display an unknown as the last known value -- resulting in the horizontal lines oyu mention. If thisis a problem, use the option 'unknaszero' to drop it to zero. Routers2 will display an unknown as a grey area; you can use the option unknasprev to mimic the native-mode MRTG behaviour, or onknaszero (as in native mode). |
|
| Page 1 of 1 | All times are UTC + 12 hours [ DST ] |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|