Hey Everyone,
I am stumped. I have this script here:
***********************************************************
dim iEventCode
dim iNumEvents
iEventCode = 1073
Set EventSet = GetObject("winmgmts:").ExecQuery _
("select * from Win32_NTLogEvent where EventCode=" & _
iEventCode)
iNumEvents = EventSet.Count
Wscript.Echo iNumEvents
************************************************************
What it does is will return how many occurences there are of that EventID in the event logs. The problem I have is that I did the walkthrough on the website and I have it run the .vbs script every 5 minutes. I have a graph created but I get no results whatsoever. Now on the forums I see stuff with XML and I am wondering if that is what I am doing wrong or what steps I need to take so that I can have Cacti graph the results from my WMI scripts.
Thanks for all your help!!
- Jimbob8483
How to graph this WMI script
Moderators: Developers, Moderators
You should associate a text tag with the output. change the output to: Wscript.Echo "Val:" & iNumEvents
That way, when you create the data input method, you can specify "Val" as an output field. Which in tern, cacti will take and store into the rra file.
Using this method would allow you to output the count on many eventID's all at once.
That way, when you create the data input method, you can specify "Val" as an output field. Which in tern, cacti will take and store into the rra file.
Using this method would allow you to output the count on many eventID's all at once.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
-
- Posts: 3
- Joined: Thu Jan 20, 2005 11:26 am
Ok here is the script now:
dim iEventCode
dim iNumEvents
iEventCode = 1073
Set EventSet = GetObject("winmgmts:").ExecQuery _
("select * from Win32_NTLogEvent where EventCode=" & _
iEventCode)
iNumEvents = EventSet.Count
Wscript.Echo "Val:" & iNumEvents
**********************************
This in turn outputs Val:7 when I run it manually.
I created a Data Input Method with the name of EventID which is a script/command input type and points to the script. For an output field I tried both Val and Val: but neither of these seem to work and produce results on the graph..it always sits at 0 when it should show 7. Is there something I am missing..also is it a problem trying to query the localhost..does it have to be a remote machine?
Thanks again!!
dim iEventCode
dim iNumEvents
iEventCode = 1073
Set EventSet = GetObject("winmgmts:").ExecQuery _
("select * from Win32_NTLogEvent where EventCode=" & _
iEventCode)
iNumEvents = EventSet.Count
Wscript.Echo "Val:" & iNumEvents
**********************************
This in turn outputs Val:7 when I run it manually.
I created a Data Input Method with the name of EventID which is a script/command input type and points to the script. For an output field I tried both Val and Val: but neither of these seem to work and produce results on the graph..it always sits at 0 when it should show 7. Is there something I am missing..also is it a problem trying to query the localhost..does it have to be a remote machine?
Thanks again!!
Who is online
Users browsing this forum: No registered users and 0 guests