VBS Help

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

Moderators: Developers, Moderators

User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You must clear the poller cache.

TheWitness
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
pshankland
Cacti User
Posts: 247
Joined: Fri Dec 31, 2004 7:07 am
Location: UK

Post by pshankland »

Just to update on the foward slashes, cleared my poller cache and the syntak is now C:/Windows/System32/cscript.exe
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Pete,

And it still does not work?

TheWitness
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
pshankland
Cacti User
Posts: 247
Joined: Fri Dec 31, 2004 7:07 am
Location: UK

Post by pshankland »

unfortunatly not :( same errors in the log file as before.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Umm, you realize that |host_hostname| is not a valid computer name right? Thats likely why the script is currently failing. In your data input method, edit the strComputer field. In Special Type Code put in: hostname. That should fix the problem.

No, I didn't mean you to post the entire rrd dump... just the relivant section around todays date would be fine (no need to right now though).
User avatar
pshankland
Cacti User
Posts: 247
Joined: Fri Dec 31, 2004 7:07 am
Location: UK

Post by pshankland »

have put hostname in the Special Type Code within the strComputer Input Field. I have also left the Custom Data field in the Data Template blank.

Am still getting no values though.

Sorry about the XML dump, will do it in a bit.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

No need for the xml dump until cacti actually collects data.

So even after putting in the proper name the Special Type Code, looking in the cacti log it's using |host_hostname|? You need to track down where you've got that.

In your date template, the strComputer field should NOT have a checkbox by it.
User avatar
pshankland
Cacti User
Posts: 247
Joined: Fri Dec 31, 2004 7:07 am
Location: UK

Post by pshankland »

Have tried both hostname and 'hostname' in the Special field and am now getting the following in the log:

Code: Select all

11/24/2005 09:15:03 AM - CACTID: Poller[0] Host[14] DEBUG: The POPEN returned the following File Descriptor 9
11/24/2005 09:15:03 AM - CACTID: Poller[0] Host[14] ERROR: Empty result [172.29.2.23]: 'C:/Windows/System32/cscript.exe //nologo D:/Cacti/scripts/w32_CPU.vbs 172.29.2.23'
11/24/2005 09:15:03 AM - CACTID: Poller[0] Host[14] DS[43] WARNING: Result from SCRIPT not valid. Partial Result: ...
11/24/2005 09:15:03 AM - CACTID: Poller[0] Host[14] DS[43] SCRIPT: C:/Windows/System32/cscript.exe //nologo D:/Cacti/scripts/w32_CPU.vbs 172.29.2.23, output: U
11/24/2005 09:15:03 AM - CACTID: Poller[0] Host[14] DEBUG: The POPEN returned the following File Descriptor 9
11/24/2005 09:15:03 AM - CACTID: Poller[0] Host[14] ERROR: Empty result [172.29.2.23]: 'C:/Windows/System32/cscript.exe //nologo D:/Cacti/scripts/w32_PhysicalDisk.vbs 172.29.2.23'
11/24/2005 09:15:03 AM - CACTID: Poller[0] Host[14] DS[42] WARNING: Result from SCRIPT not valid. Partial Result: ...
11/24/2005 09:15:03 AM - CACTID: Poller[0] Host[14] DS[42] SCRIPT: C:/Windows/System32/cscript.exe //nologo D:/Cacti/scripts/w32_PhysicalDisk.vbs 172.29.2.23, output: U
any ideas?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Work with cmd.php ?

Running cscript //nologo D:/Cacti/scripts/w32_CPU.vbs 172.29.2.23 works right?
User avatar
pshankland
Cacti User
Posts: 247
Joined: Fri Dec 31, 2004 7:07 am
Location: UK

Post by pshankland »

Ahhhh, now using cmd.php with all the other changed seems to work.

I'll leave it running for a while and post the results then.

But fingers crossed :lol: :lol: :lol:
User avatar
pshankland
Cacti User
Posts: 247
Joined: Fri Dec 31, 2004 7:07 am
Location: UK

Post by pshankland »

Thanks Larry & BSOD2600 it appears as though I am now able to get the data through with using cmd.php rather than catid - so cheers for all the help.

I am moving this up a notch now :wink: . I want to create a graph that shows IIS information and for this the graph needs to have 3 outputs and 1 input. I have created the following script which outputs the results as the cacti manual says (<fieldname1>:<value1> <fieldname2>:<value2>...)

Code: Select all

strComputer=Wscript.Arguments.Item(0)
Set objWMIService=GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set objIIS=objWMIService.instancesof("Win32_PerfRawData_W3SVC_WebService")
For Each objItem in objIIS
	CurrentConnections=objItem.CurrentConnections
	CurrentAnonymousUsers=objItem.CurrentAnonymousUsers
	CurrentNonAnonymousUsers=objItem.CurrentNonAnonymousUsers
Next

Wscript.Echo "CurrentConnections:" & CurrentConnections &" CurrentAnonymousUsers:" & CurrentAnonymousUsers & " CurrentNonAnonymousUsers:" & CurrentNonAnonymousUsers
When running this in the command prompt I get the following:

Code: Select all

CurrentConnections:13 CurrentAnonymousUsers:0 CurrentNonAnonymousUsers:0
I have created the Data Input Method with 1 input field and 3 output fields. Then created the Data Template with 3 Data Sources each pointing to the different Data Input Methods output fields. Finally created a simple Graph Template.

Only problem is that the graph isn't bringing back anything except NaN. The cacti log looks ok though:
11/24/2005 01:05:05 PM - CMDPHP: Poller[0] Host[16] DS[48] CMD: c:/windows/system32/cscript.exe //nologo D:/Cacti/scripts/w32_IIS.vbs, output: U
Any help would be useful.

Thanks.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Did you try this version of Cactid?

TheWitness

http://forums.cacti.net/viewtopic.php?t ... c&start=15
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
pshankland
Cacti User
Posts: 247
Joined: Fri Dec 31, 2004 7:07 am
Location: UK

Post by pshankland »

Again, to make things a bit easier to understand I have put the screenshots and log on my webserver:

Screenshots of the creation of this graph
Last 20mins from my Cacti Logfile

Hope someone can help me with this.

Thanks.
User avatar
pshankland
Cacti User
Posts: 247
Joined: Fri Dec 31, 2004 7:07 am
Location: UK

Post by pshankland »

Larry, was using cmd.php but have started using the new cactid again. For some reason the single output vbs are now working with this new cactid but unfortunatly, I am still getting NaN on the new multiple out vbs.

Thanks
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Can you compile Cactid?

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?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests