At last - Windows Services monitoring with WMI!

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

DHornby
Posts: 8
Joined: Mon Nov 02, 2009 3:18 am

Post by DHornby »

cscript C:/inetpub/wwwroot/cacti/scripts/Win32_Services.vbs vmfileprint01.tsplc.co.uk W32Time, output: U

I'm getting -1 when I run from the command line but the poller log is showing the above error (No returned value)
Scheduled task is running with the highest priveledges! Any ideas?
DHornby
Posts: 8
Joined: Mon Nov 02, 2009 3:18 am

Post by DHornby »

OK....I've changed back to cmd.php and now get the following in the log

11/20/2009 12:41:01 PM - CMDPHP: Poller[0] Host[2] DS[177] CMD: cscript //nologo C:/inetpub/wwwroot/cacti/scripts/Win32_Services.vbs localhost W32Time, output: -1

Whch is good! BUT I get no graph.

The data source bebug shows this:

d:/rrdtool/rrdtool.exe create \
C:/inetpub/wwwroot/cacti/rra/vmw2k8cacti01_service_state_177.rrd \
--step 60 \
DS:service_state:GAUGE:120:-1:1 \
RRA:AVERAGE:0.5:1:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:500 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \

Which looks OK.

But under graph mamagement I get :

d:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-60 \
--title="VMW2K8CACTI01 - Service: W32Time" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--upper-limit=0 \
--lower-limit=-1 \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="C\:/inetpub/wwwroot/cacti/rra/vmw2k8cacti01_service_state_177.rrd":service_state:LAST \
AREA:a#00CF00FF:"Service State" \
GPRINT:a:LAST:"%8.0lf\n" \
COMMENT:"(-1 = Running, 0 = Stopped)"
RRDTool Says:

ERROR: the RRD does not contain an RRA matching the chosen CF

Can anybody help! I'm desperate for a way of monitoring certain services atthe moment.

Regards
Dave
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

ERROR: the RRD does not contain an RRA matching the chosen CF

Can anybody help! I'm desperate for a way of monitoring certain services atthe moment.

Regards
Dave
Go to DATASOURCES / RRAs / and click each of the 6 RRA configs. When each one opens, ensure that LAST is selected, and click SAVE

You need to delete the services graph, and recreate it.

If you want an easy fix, go into the Service Graph Template, click each item, and change the Consolidation Function (CF) to AVERAGE from LAST

PS - The Windows Services script and template from Cigamit (Jimmy) is MUCH faster, as it uses SNMP and not WMI.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
DHornby
Posts: 8
Joined: Mon Nov 02, 2009 3:18 am

Post by DHornby »

mcutting........You are an absolute star!!

That worked perfectly! I'll take a look at Cigamits script when I get a chance as well.
mon22oct
Posts: 11
Joined: Fri Oct 16, 2009 11:14 am

Post by mon22oct »

DHornby wrote:cscript C:/inetpub/wwwroot/cacti/scripts/Win32_Services.vbs vmfileprint01.tsplc.co.uk W32Time, output: U

I'm getting -1 when I run from the command line but the poller log is showing the above error (No returned value)
Scheduled task is running with the highest priveledges! Any ideas?

I am currently exactly at the same issue.
In the reply following the above quote....some one said...they have changed cmd.php,......what is it exactly.

Any help
mon22oct
Posts: 11
Joined: Fri Oct 16, 2009 11:14 am

Post by mon22oct »

Right now this is what I found in log file

11/25/2009 01:35:45 PM - CMDPHP: Poller[0] Host[3] DS[410] CMD: cscript C:/inetpub/wwwroot/cacti/scripts/win32_services.vbs localhost W32Time, output: Microsoft (R) Windows Script Host Version 5.7
mon22oct
Posts: 11
Joined: Fri Oct 16, 2009 11:14 am

Post by mon22oct »

Sory.
I've added nologo in the input string,

11/25/2009 03:40:45 PM - CMDPHP: Poller[0] Host[3] DS[410] CMD: cscript //nologo C:/inetpub/wwwroot/cacti/scripts/Win32_Services.vbs localhost W32Time, output: U

still the output in the log file = U

Please help
mon22oct
Posts: 11
Joined: Fri Oct 16, 2009 11:14 am

Post by mon22oct »

Anyways went through the topics here.http://forums.cacti.net/viewtopic.php?t ... &start=105

That works fine.

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest