[mrtg] Re: DOS popup boxes with external Perl Script

dhazell at aap.com.au dhazell at aap.com.au
Thu Feb 19 07:44:29 MET 2004


Michael
One suggestion to stop these new windows popping up, is that you can use the
Win32::Process perl module to start sub-processes. The CREATE_NO_WINDOW
switch will suppress these new windows. (See script below for example ...)

Cheers
Derek

#############################################
see http://www.xav.com/perl/site/lib/Win32/Process.html for more info ...
#############################################
#!/usr/bin/perl -w
.
.
use Win32::Process; #set up module to handle subprocesses ...
.
.
#kick off a(nother) sub process to run mrtg against a target ...
print("perl $MrtgBinDir/mrtg $MrtgCfgDir/$TgtName.final.cfg to be run. ");
   Win32::Process::Create(${ProcessObject.$TgtName},
   "c:/perl/bin/perl.exe",
   "perl $MrtgBinDir/mrtg $MrtgCfgDir/$TgtName.final.cfg",
   0,
   CREATE_NO_WINDOW,
   ".") || die "Create: $!";
if (${ProcessObject.$TgtName}) {
   print "Process started with process id : ",
${ProcessObject.$TgtName}->GetProcessID(), " ";
}
##############################################

-----Original Message-----
From: michael rizk [mailto:michael.rizk at thespecializt.com]
Sent: Thursday, 19 February 2004 1:08 PM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] DOS popup boxes with external Perl Script


I have configured the MRTG cfg file to use an external Perl script to gather
data as follows.
 

Target[db1-memory-availableBytes]:`perl c:\TheSpecializt\getlog2.pl
Z:\DB1.CSV "\\DB1\Memory\Available Bytes"`

 

This works perfectly but what happens is it spawns a cmd session and a perl
session for each device. So you could imagine when monitoring 15 devices
each having 6 items being probed the number of DOS popup boxes that appears
becomes quite annoying.

 

MRTG is setup to run as a daemon and is started as follows.

 

start /MIN /B /Dc:\mrtg-2.9.29\bin wperl mrtg --logging=eventlog
C:\TheSpecializt\Client_Services\Utilisation_Graphs\TheSpecializt\Cfg\mrtg.c
fg

 

As you can see I tried using the START command with the /MIN and /B switches
no luck. I also tried sticking the START command and switches in the cfg
file but also no luck.

 

Any ideas?

 

Regards,

 

Michael Rizk 
MCSE 2000, MCSE NT, CCNA, CCA XP, CLP
Senior Network Engineer 
The Specializt Pty Ltd 
Unit 15/56 O'Riordan Street,Alexandria, 2015
151º 14' 51" EAST, 33º 57' 23" SOUTH 
Tel 61-2-83377000, Fax 61-2-83377077

 


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi


******************************************************************************
This email is intended for the use of the addressee only.  If you receive this email in error, please delete it immediately.  This email may contain information which is confidential and/or legally privileged.  You must not use or disclose the contents of this email, or add the sender's email address to any database, list or mailing list unless you are expressly authorised to do so.
 
The statements or views expressed in this email are those of the individual sender and are not those of Australian Associated Press Pty Ltd (AAP).  These statements are not binding on AAP, except where the sender expressly and with authority, states them to be.
 
AAP is unable to review the contents of all the email on its system.  To the extent permitted by law, AAP disclaims all liability for any loss or damage caused by the contents of this email.
******************************************************************************

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list