[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/bbcode.php on line 112: 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 112: 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 112: 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 - MRTG-Pnsclinet.pl

Cheshire Cat Computing

Software support and information
It is currently Wed Nov 12, 2025 11:28 pm

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: MRTG-Pnsclinet.pl
PostPosted: Sun Aug 29, 2004 9:37 am 
Offline
User

Joined: Sun Aug 29, 2004 9:32 am
Posts: 7
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


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Sun Aug 29, 2004 8:15 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
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.

_________________
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: Mon Aug 30, 2004 5:20 am 
Offline
User

Joined: Sun Aug 29, 2004 9:32 am
Posts: 7
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
---------------------------------------------------------------


Top
 Profile Send private message  
 
 Post subject: Ammending that last post
PostPosted: Mon Aug 30, 2004 5:25 am 
Offline
User

Joined: Sun Aug 29, 2004 9:32 am
Posts: 7
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!


Top
 Profile Send private message  
 
PostPosted: Tue Aug 31, 2004 6:05 am 
Offline
User

Joined: Sun Aug 29, 2004 9:32 am
Posts: 7


Top
 Profile Send private message  
 
 Post subject: Updating did not help
PostPosted: Wed Sep 01, 2004 8:01 am 
Offline
User

Joined: Sun Aug 29, 2004 9:32 am
Posts: 7


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Wed Sep 01, 2004 11:31 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
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?

_________________
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: Thu Sep 02, 2004 3:19 am 
Offline
User

Joined: Sun Aug 29, 2004 9:32 am
Posts: 7
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?


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Sep 02, 2004 9:56 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
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).

_________________
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  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 10:06 am 
Offline
User

Joined: Sat May 01, 2004 4:33 am
Posts: 6


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next

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