Annoying command windows!

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
adambertram
Posts: 1
Joined: Wed Sep 14, 2005 4:40 pm

Annoying command windows!

Post by adambertram »

I FINALLY got Cacti up and running after about 5 hours and it was well worth it! This is a VERY cool product. However, I have a small problem. I am running it on my Windows XP workstation and every time it polls, the annoying command windows come up for a few seconds and go off again. Does anyone know of any voodoo I can apply to the scheduled task to do away with the windows or at least minimize them.

I appreciate any help!

Thanks!
Utildayael
Posts: 34
Joined: Wed Sep 14, 2005 9:25 am
Location: Omaha, NE

Post by Utildayael »

I would imagine you can use srvany from the resource kit to make it run as a service instead of a scheduled task. I haven't tried it yet myself [still trying to get my graphs fixed before I muck with it *g*].

Here's a direct quote from the MRTG setup guide, just modify accordingly for running the poller.php ... you'll have to create the .reg file as well but that is pretty cake. Or, you can just make the keys in the registry. :P
HOW TO SETUP MRTG AS A WINDOWS SERVICE

Additional Prerequisites
MRTG must be installed and fully configured on the target system. In the following exercise the assumption is that MRTG is installed under c:\mrtg\ and all the sample files use this location.

Microsoft Tools SRVANY.exe (Applications as Services Utility) and INSTSRV.exe (Service Installer) - Those files can be downloaded from Microsoft as a part of Windows 2000 Resource Kit at http://www.microsoft.com/windows2000/te ... efault.asp. They are also available from other locations such as http://www.electrasoft.com/srvany/srvany.htm, http://www.iopus.com/guides/srvany.htm, etc. Detailed instructions on how to use this package are available at http://support.microsoft.com/kb/q137890/. In order to follow the steps in this HOWTO you MUST obtain both executables.

You must have administrative rights on the target system.


Preparation
Please complete the following steps before starting the installation:

Copy srvany.exe and instsrv.exe to c:\mrtg\bin\ (your MRTG bin directory).

Create a file called mrtg.reg anywhere on your system and paste the following content into it:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRTG\Parameters]
"Application"="c:\\perl\\bin\\wperl.exe"
"AppParameters"="c:\\mrtg\\bin\\mrtg --logging=eventlog c:\\mrtg\\bin\\mrtg.cfg"
"AppDirectory"="c:\\mrtg\\bin\\"

Installation
Once again, assuming that MRTG is already fully installed and configured on the target system under c:\mrtg\ the following steps are necessary to setup MRTG as a service.

Using the command prompt go into the temporary directory where you unzipped the package. When there type the following command to create a service named ``MRTG'' in the Windows Services management console:


instsrv MRTG c:\mrtg\bin\srvany.exeNow you need to create the App* entries required for the new service. You can do this by either right-clicking on the mrtg.reg file and selecting 'merge' or by running the following command:

regedit /s mrtg.regAfter setting up the registry entry it is time to point it to your MRTG installation. If you have installed MRTG under c:\mrtg\, you can skip this step. Open your registry editor (Start -> Run -> regedt32), and locate the [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRTG] key. Make sure that the ImagePath variable is correctly pointing to srvany.exe located in your MRTG bin directory (for example c:\mrtg\bin\srvany.exe). Next you have to expand the MRTG tree, and go to the [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRTG\Parameters] key. Under Parameters make sure that all the Application variables are setup propperly.

At this point you are ready to run the service. The only thing left to do is to start the MRTG service in the Services management console. After you do this, you should see two new processes running on your system: srvany.exe and wperl.exe. Make sure to stop any previously running MRTG processes to avoid confict.
Full article and credits located here.

Disclaimer: I haven't tried this on Cacti yet so it may not work, may break things, YMMV, etc etc. :wink:
Last edited by Utildayael on Wed Sep 14, 2005 4:52 pm, edited 1 time in total.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) Run it under a different user account than the one currently logged into the box.
2) Use a vbs script to hide the windows.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

With O.8.6G, you should run as the USER = SYSTEM to prevent nasty Windoz registry warnings upon exit.

Larry
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

TheWitness wrote:With O.8.6G, you should run as the USER = SYSTEM to prevent nasty Windoz registry warnings upon exit.
Funny thing, I don't see those on my installation. What message(s) do you see exactly?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Application warnings about not being able to log off due to a registry in use. This may be limited to a system that is part of AD. Don't know. I have a sizable installation and the RRD stuff goes on for a bit after the Poller has completed and the process has stoped.

Larry
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Odd. My cacti server is a domain controller for my AD domain. I don't recall seeing any of those messages.
Utildayael
Posts: 34
Joined: Wed Sep 14, 2005 9:25 am
Location: Omaha, NE

Post by Utildayael »

Haven't had that problem on the box I have it on either. I switched it to system just for kicks. Win2k member server is the box on a AD domain. *shrug*

Scheduled tasks don't actually logon to the machine, they just run as the context of the user specified IIRC. Weird that you get those errors tho...

There is a hive cleanup utility from MS has that will fix those errors as well if they persist.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests