| Cheshire Cat Computing http://www.steveshipway.org/forum/ |
|
| MRTG-Pnsclinet.pl http://www.steveshipway.org/forum/viewtopic.php?f=2&t=356 |
Page 1 of 2 |
| Author: | Don [ Sun Aug 29, 2004 9:37 am ] |
| Post subject: | MRTG-Pnsclinet.pl |
Hey, Not sure if I put this in under the correct topic.... I am attempting to use the mrtg-pnsclinet.pl with the following config. # Defaults routers.cgi*Mode[_]: generic PathAdd: c:\mrtg\rrdtool LogFormat: rrdtool workdir: c:\mrtg/wwwroot ############################################### # Targets # CPU Target[CRIRAS-cpu]: 'mrtg-pnsclient.pl -H 192.168.1.1 -v CPULOAD -l 5 -l 15' Title[CRIRAS-cpu]: RAS CPU Activity MaxBytes[CRIRAS-cpu]: 100 PageTop[CRIRAS-cpu]: null LegendI[CRIRAS-cpu]: 5min : LegendO[CRIRAS-cpu]: 15min: Options[CRIRAS-cpu]: gauge growright Ylegend[CRIRAS-cpu]: percent ShortLegend[CRIRAS-cpu]: % Legend1[CRIRAS-cpu]: 5minute average Legend2[CRIRAS-cpu]: 15minute average Legend3[CRIRAS-cpu]: Peak 5min average Legend4[CRIRAS-cpu]: Peak 15min average SetEnv[CRIRAS-cpu]: MRTG_INT_DESCR="CPU" routers.cgi*Options[CRIRAS-cpu]: fixunit nototal nopercent routers.cgi*Icon[CRIRAS-cpu]: chip-sm.gif And when I attempt to run the script manually I recieve the following error: ERROR: Target[ras-cpu][_IN_] ''mrtg-pnsclient.pl -H 192.168.1.1 - v CPULOAD -l 5 -l 15'' evaluated to 'mrtg-pnsclient.pl -H 192.168.1.1 -v CPULOAD -l 5 -l 15' instead of a number Perhaps I have put my mrtg-pnsclient.pl in the incorrect spot? Oh, and if I run mrtg-pnsclient.pl manuall, I do recieve a numerical value back.... Any hints would be appreciated! -Don mccallum@nemsys.com |
|
| Author: | stevesh [ Sun Aug 29, 2004 8:15 pm ] |
| Post subject: | |
You need to use BACKQUOTES (`) in the MRTG Target definition, not normal quotes (') so that MRTG knows it is an external function call. Also, you may need to put the full pathname of the mrtg-pnsclient.pl script, if it is not in the path. |
|
| Author: | Don [ Mon Aug 30, 2004 5:20 am ] |
| Post subject: | Getting Closer.... or at least different errors. :) |
Thanks for the quick reply Steve! Here is the new test2.cfg --------------------------------------------- Interval: 1 PathAdd: c:\mrtg\rrdtool LogFormat: rrdtool WithPeak[_]: ymw workdir: c:\mrtg/wwwroot Options[_]: bits,growright routers.cgi*Mode[_]: generic # Targets # CPU Target[Nemras-cpu]: `c:\mrtg\mrtg\bin\mrtg-pnsclient.pl -H 192.168.2.227 -v CPULOAD -l 5 -l 15` Title[Nemras-cpu]: Nemras CPU Activity MaxBytes[Nemras-cpu]: 100 PageTop[Nemras-cpu]: null LegendI[Nemras-cpu]: 5min : LegendO[Nemras-cpu]: 15min: Options[Nemras-cpu]: gauge growright Ylegend[Nemras-cpu]: percent ShortLegend[Nemras-cpu]: % Legend1[Nemras-cpu]: 5minute average Legend2[Nemras-cpu]: 15minute average Legend3[Nemras-cpu]: Peak 5min average Legend4[Nemras-cpu]: Peak 15min average SetEnv[Nemras-cpu]: MRTG_INT_DESCR="CPU" routers.cgi*Options[Nemras-cpu]: fixunit nototal nopercent routers.cgi*Icon[Nemras-cpu]: chip-sm.gif ------------------------------------------------------------------- When I run from the command line I recieve ------------------------------------------------------------------- C:\mrtg\mrtg\bin>\mrtg\perl\bin\perl.exe mrtg test2.cfg WARNING: Problem with External get 'c:\mrtg\mrtg\bin\mrtg-pnsclient.pl -H 192.16 8.2.227 -v CPULOAD -l 5 -l 15': Expected a Number for 'in' but got 'U' ------------------------------------------------------------- However, perhaps this is the issue? When I execute the mrtg-pnsclient.pl directly I recieve a mixed result return, including the version number... Also, the target machine has dual CPU's, hence the two 6%.. -------------------------------------------------------------- C:\mrtg\mrtg\bin>c:\mrtg\perl\bin\perl.exe c:\mrtg\mrtg\bin\mrtg-pnsclient.pl -H 192.168.2.227 -v CPULOAD -l 5 -l 15 6 6 Netsaint agent version 1.0.8.4 --------------------------------------------------------------- |
|
| Author: | Don [ Mon Aug 30, 2004 5:25 am ] |
| Post subject: | Ammending that last post |
Actually, I think I just found the error. When I ran this from command line but pointed to a machine by name that did not resolve I recieve this error: --------------------------------------------------- C:\mrtg\mrtg\bin>c:\mrtg\perl\bin\perl.exe c:\mrtg\mrtg\bin\mrtg-pnsclient.pl -H fs1 -v CPULOAD -l 5 -l 15 U U Unable to resolve fs1: Unknown error --------------------------------------------------- Those are the "U"'s mentioned in my earlier post.... it looks like the -H 192.168.2.227 is perhaps not being parsed properly? Thanks again for the assistance! |
|
| Author: | Don [ Tue Aug 31, 2004 6:05 am ] |
| Post subject: | Has anybody else used this function? |
| Author: | Don [ Wed Sep 01, 2004 8:01 am ] |
| Post subject: | Updating did not help |
| Author: | stevesh [ Wed Sep 01, 2004 11:31 am ] |
| Post subject: | |
I would normally have expected that, if it works as expected from the command line, then it will work as expected from within MRTG. I'm a bit confused as to why it wouldn't work. Obviously we use it here extensively with no problems. It will return U (unknown) if for any reason it is unable to connect or get a sensible reply. The reason for this will be in line 4 of the output. Since you get the expected response when running directly from the command line, but U when run from within MRTG, maybe it is a problem with permissions, or Perl libraries? Maybe (as this is windows) you need to call it as 'perl.exe mrtg-pnsclient.pl .....' (with full path names) within MRTG? So far, I am unable to duplicate this. Anyone else have this problem? |
|
| Author: | Don [ Thu Sep 02, 2004 3:19 am ] |
| Post subject: | Using the full path helps |
Great idea Steve. Changing my: Target[nemras]:`mrtg-pnsclient.pl -H nemras -V CPU -l 5 -l 15` to: Target[nemras]:`c:\mrtg\perl\bin\perl.exe c:\mrtg\mrtg\bin\mrtg-pnsclient.pl -H nemras -V CPU -l 5 -l 15` Did the trick for CPU polling. However for some reason none of the other counters are working yet.... but I will work on those. No errors now running perl mrtg test4.cfg. Thanks for the help Steve! p.s. What version of the pnsclient to you recommend on Windows boxes? |
|
| Author: | stevesh [ Thu Sep 02, 2004 9:56 am ] |
| Post subject: | |
Here, we use PNS v2.0.1.0, so I know this one definitely works as expected. I wouldn't use v1.x (I think its incompatible anyway). There may be a later version than 2.0.1.0 now, I haven't checked -- if it works, then probably it's a good idea to use it. The mrtg-pnsclient.pl script doesn't support all of the new commands that the later pnsclients support. Many are inappropriate in any case (ie, ungraphable). |
|
| Author: | jon [ Thu Nov 11, 2004 10:06 am ] |
| Post subject: | |
| Page 1 of 2 | All times are UTC + 12 hours [ DST ] |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|