Monitor Windows via WMI from Cacti on Linux

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

Moderators: Developers, Moderators

Post Reply
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

Not sure what's going on, just doesn't seem to be reading your password file. Other than checking the pw file is in the right format not really sure what I can suggest. Is this the latest build of wmi-client from zenoss?
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

garnser wrote:I've verified that the permissions are correct but still no luck.

The only other issue is that when I loaded the template from the trunk I got a XML hash error, the ones from branches worked though.
The XML hash errors could be caused from using different versions of cacti. Not sure what your talking about branch versions as they were only ever temporary testing stuff. Did you meant trunk/tag?

Can you turn the debug up on cacti anymore to see whats going on when it trys to run the script.
garnser
Posts: 9
Joined: Wed Jan 13, 2010 6:10 am

Post by garnser »

There's 2 templates folder in the svn:
- trunk/templates
- branches/auth-file/templates/

I'm currently using 0.8.7d-1.

Here's the Data Source Debug for Disk I/O, are you referring to some other debug mode than this?
/usr/bin/rrdtool create \
/var/lib/cacti/rra/bineronode2_writespersec_3117.rrd \
--step 300 \
DS:WritesPersec:COUNTER:600:0:500000 \
DS:ReadsPersec:COUNTER:600:0:500000 \
DS:QueueLength:GAUGE:600:0:10000 \
DS:WriteBytesPersec:COUNTER:600:0:500000 \
DS:ReadBytesPersec:COUNTER:600:0:500000 \
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 \

Thanks
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

garnser wrote:There's 2 templates folder in the svn:
- trunk/templates
- branches/auth-file/templates/

I'm currently using 0.8.7d-1.

Here's the Data Source Debug for Disk I/O, are you referring to some other debug mode than this?
/usr/bin/rrdtool create \
/var/lib/cacti/rra/bineronode2_writespersec_3117.rrd \
--step 300 \
DS:WritesPersec:COUNTER:600:0:500000 \
DS:ReadsPersec:COUNTER:600:0:500000 \
DS:QueueLength:GAUGE:600:0:10000 \
DS:WriteBytesPersec:COUNTER:600:0:500000 \
DS:ReadBytesPersec:COUNTER:600:0:500000 \
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 \

Thanks
Yer the branch versions are purely testing hey. They probably won't work properly. You should only be using stuff from tags cause those are released builds or trunk which again should only use trunk templates with trunk scripts. Ideally anyway.

Nah the debug im talking about is in the cacti settings, you can increase the logging level to get more info about whats happening when the poller is running. Not the graph debug.
garnser
Posts: 9
Joined: Wed Jan 13, 2010 6:10 am

Post by garnser »

Here's some more verbose output, should I increase it more?

01/14/2010 12:55:21 PM - CACTID: Poller[0] Host[141] DS[3119] WARNING: Result from SCRIPT not valid. Partial Result: ...
01/14/2010 12:55:21 PM - CACTID: Poller[0] Host[141] DS[3119] SCRIPT: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php xx.xx.xx.xx credential Win32_PerfRawData_PerfOS_Memory CommittedBytes,AvailableBytes,CommitLimit , output: U
01/14/2010 12:55:21 PM - CACTID: Poller[0] Host[141] DS[3121] WARNING: Result from SCRIPT not valid. Partial Result: ...
01/14/2010 12:55:21 PM - CACTID: Poller[0] Host[141] DS[3121] SCRIPT: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php xx.xx.xx.xx credential Win32_PerfFormattedData_PerfOS_Processor PercentProcessorTime , output: U
01/14/2010 12:55:21 PM - CACTID: Poller[0] Host[141] DS[3109] SS[0] SERVER: /usr/share/cacti/site/scripts/ss_host_disk.php ss_host_disk xx.xx.xx.xx 141 2:161:500:1:4:host:::MD5::DES: get total 2, output: 53684989952
01/14/2010 12:55:21 PM - CACTID: Poller[0] Host[141] DS[3109] SS[0] SERVER: /usr/share/cacti/site/scripts/ss_host_disk.php ss_host_disk xx.xx.xx.xx 141 2:161:500:1:4:host:::MD5::DES: get used 2, output: 33025363968
01/14/2010 12:55:21 PM - CACTID: Poller[0] Host[141] DS[3110] SS[0] SERVER: /usr/share/cacti/site/scripts/ss_host_disk.php ss_host_disk xx.xx.xx.xx 141 2:161:500:1:4:host:::MD5::DES: get total 3, output: 42946523136
01/14/2010 12:55:21 PM - CACTID: Poller[0] Host[141] DS[3110] SS[0] SERVER: /usr/share/cacti/site/scripts/ss_host_disk.php ss_host_disk xx.xx.xx.xx 141 2:161:500:1:4:host:::MD5::DES: get used 3, output: 26897321984
01/14/2010 12:55:21 PM - CACTID: Poller[0] Host[141] DS[3111] SS[0] SERVER: /usr/share/cacti/site/scripts/ss_host_disk.php ss_host_disk xx.xx.xx.xx 141 2:161:500:1:4:host:::MD5::DES: get total 4, output: 0
01/14/2010 12:55:21 PM - CACTID: Poller[0] Host[141] DS[3111] SS[0] SERVER: /usr/share/cacti/site/scripts/ss_host_disk.php ss_host_disk xx.xx.xx.xx 141 2:161:500:1:4:host:::MD5::DES: get used 4, output: 0
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3120] WARNING: Result from SCRIPT not valid. Partial Result: ...
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3120] SCRIPT: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php xx.xx.xx.xx credential Win32_ComputerSystem TotalPhysicalMemory , output: U
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3115] WARNING: Result from SCRIPT not valid. Partial Result: ...
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3115] SCRIPT: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php xx.xx.xx.xx credential Win32_PerfRawData_PerfDisk_LogicalDisk DiskWritesPersec,DiskWriteBytesPersec,DiskReadsPersec,DiskReadBytesPersec,CurrentDiskQueueLength Name E\:, output: U
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3116] WARNING: Result from SCRIPT not valid. Partial Result: ...
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3116] SCRIPT: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php xx.xx.xx.xx credential Win32_PerfRawData_PerfDisk_LogicalDisk DiskWritesPersec,DiskWriteBytesPersec,DiskReadsPersec,DiskReadBytesPersec,CurrentDiskQueueLength Name C\:, output: U
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3117] WARNING: Result from SCRIPT not valid. Partial Result: ...
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3117] SCRIPT: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php xx.xx.xx.xx credential Win32_PerfRawData_PerfDisk_LogicalDisk DiskWritesPersec,DiskWriteBytesPersec,DiskReadsPersec,DiskReadBytesPersec,CurrentDiskQueueLength Name D\:, output: U
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3113] SNMP: v2: xx.xx.xx.xx, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.14, value: 273143213
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3113] SNMP: v2: xx.xx.xx.xx, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.14, value: 61637779
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3114] SNMP: v2: xx.xx.xx.xx, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.15, value: 774612306
01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3114] SNMP: v2: xx.xx.xx.xx, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.15, value: 2238039875
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

garnser wrote: 01/14/2010 12:55:22 PM - CACTID: Poller[0] Host[141] DS[3117] SCRIPT: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php xx.xx.xx.xx credential Win32_PerfRawData_PerfDisk_LogicalDisk DiskWritesPersec,DiskWriteBytesPersec,DiskReadsPersec,DiskReadBytesPersec,CurrentDiskQueueLength Name D\:, output: U
I think you have mixed something up hey. What version of the wmi.php have you got installed and with what templates. Cause that doesn't look right. E.g. the older Pre 0.0.6 style of passing arguments. However this could be purely because you've loaded the wrong set of templates.

What version of Cacti are you running as well? As the 0.0.6 and older releases really targeted 0.8.7b, they work on newer versions but you need to adjust a couple of the CDEF's as mentioned many times before through the thread.
Taltos
Posts: 16
Joined: Wed Dec 16, 2009 6:32 am

Post by Taltos »

claymen wrote:Not sure what's going on, just doesn't seem to be reading your password file. Other than checking the pw file is in the right format not really sure what I can suggest. Is this the latest build of wmi-client from zenoss?
Hi
Day 4, light trun on in my head

when you say:
AUTH FILE FORMAT
The auth file contains the username and password of the service account you are using
to run the WMI queries. Simply create the file as per the format below and set the
permissions on it so that no one else but the cacti user can read it.
username=<your username>
password=<your password>
domain=<your domain>
we must put
username=user
not username=<user> :oops:

so, now after many try... It'doesn't work :cry:

time to new start I have delete all my windows host.
delete all wmi CDEFs and GPRINT Presets in graph mangement
delete all wmi script/command inData Input Methods
delete all wmi gaph and data template
delate all windows host rrd in /rra
delete wmi.php in /scripts
restart my debian box
DL tarball found at http://svn.parkingdenied.com/listing.ph ... tags_0.0.6_

extract tarball
copy wmi.php into /scripts
import template cacti_graph_template_windows_-_memory_usage_wmi.xml

create a new host, make a new graph with Windows - Memory Usage (WMI) template

turn on graph debug mode and get this result now:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="srvad01 - Memory Usage" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Bytes" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/srvad01_commitlimit_115.rrd":CommitLimit:AVERAGE \
DEF:b="/var/www/cacti/rra/srvad01_totalphysicalmemory_116.rrd":TotalPhysicalMemory:AVERAGE \
DEF:c="/var/www/cacti/rra/srvad01_commitlimit_115.rrd":AvailableBytes:AVERAGE \
DEF:d="/var/www/cacti/rra/srvad01_commitlimit_115.rrd":CommittedBytes:AVERAGE \
CDEF:cdefi=e,i,- \
AREA:a#562B29FF:"Commit Limit\:"  \
GPRINT:a:LAST:"  Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"  \
AREA:b#FF5700FF:"Total RAM\:"  \
GPRINT:b:LAST:"     Current\:%8.2lf %s"  \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n"  \
AREA:cdefi#8F005CFF:"Used RAM\:"  \
GPRINT:cdefi:LAST:"      Current\:%8.2lf %s"  \
GPRINT:cdefi:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefi:MAX:"Maximum\:%8.2lf %s\n"  \
LINE2:d#FFFF00FF:"Commited Bytes\:"  \
GPRINT:d:LAST:"Current\:%8.2lf %s"  \
GPRINT:d:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:d:MAX:"Maximum\:%8.2lf %s\n" 

RRDTool Says:

ERROR: invalid rpn expression in: e,i,-
definitively lost
Last edited by Taltos on Fri Jan 15, 2010 4:38 am, edited 1 time in total.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

The line

Code: Select all

CDEF:cdefi=e,i,- 
should be something like

Code: Select all

CDEF:cdefi=b,c,-
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Taltos
Posts: 16
Joined: Wed Dec 16, 2009 6:32 am

Post by Taltos »

phalek wrote:The line

Code: Select all

CDEF:cdefi=e,i,- 
should be something like

Code: Select all

CDEF:cdefi=b,c,-
YESSSSSSSSSSSSSSSSSSSS


thx a lot !!!!!!
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

Yer the CDEF's get messed around because the number of inputs per graph changed in 0.8.7b. I built all my templates using that so after they changed it back in later versions the CDEF's need updating. Keeping that in mind the templates in the current trunk ARE updated to suit newer versions of cacti.
garnser
Posts: 9
Joined: Wed Jan 13, 2010 6:10 am

Post by garnser »

hi again claymen

I'm using the wmi.php available here http://svn.parkingdenied.com/CactiWMI/trunk/ and the templates available here http://svn.parkingdenied.com/CactiWMI/b ... templates/ as the templates in trunk didn't work, the cacti version is 0.8.7d-1

wmi.php says:
$version = '0.0.7-SVN'; // version
Last edited by garnser on Fri Jan 15, 2010 7:04 am, edited 2 times in total.
Taltos
Posts: 16
Joined: Wed Dec 16, 2009 6:32 am

Post by Taltos »

claymen wrote:Yer the CDEF's get messed around because the number of inputs per graph changed in 0.8.7b. I built all my templates using that so after they changed it back in later versions the CDEF's need updating. Keeping that in mind the templates in the current trunk ARE updated to suit newer versions of cacti.
I'm sorry, You must think I'm stupid but with my cacti 0.8.7e, what do I download ?

the wmi.php and all xml that I find in
http://svn.parkingdenied.com/listing.ph ... path_trunk_

:oops:

:roll: garnser have the same pb ^^ poor claymen in don't have chance with us
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

garnser wrote:hi again claymen

I'm using the wmi.php available here http://svn.parkingdenied.com/CactiWMI/trunk/ and the templates available here http://svn.parkingdenied.com/CactiWMI/b ... templates/ as the templates in trunk didn't work, the cacti version is 0.8.7d-1

wmi.php says:
$version = '0.0.7-SVN'; // version
Hmmm your log output seems to imply it's not the trunk build of the templates..
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

Taltos wrote:
claymen wrote:Yer the CDEF's get messed around because the number of inputs per graph changed in 0.8.7b. I built all my templates using that so after they changed it back in later versions the CDEF's need updating. Keeping that in mind the templates in the current trunk ARE updated to suit newer versions of cacti.
I'm sorry, You must think I'm stupid but with my cacti 0.8.7e, what do I download ?

the wmi.php and all xml that I find in
http://svn.parkingdenied.com/listing.ph ... path_trunk_

:oops:

:roll: garnser have the same pb ^^ poor claymen in don't have chance with us
Sorry im talking about cacti versions. When I was developing the script + templates cacti handled the graphs a certain way with 4 inputs per data source (to improve accuracy) then in the next version of cacti they went back to the old way which breaks the CDEF because it relied on the inputs being in certain places.

Really you have 2 choices, use trunk build wmi.php and templates which *Should* work but keep in mind they are dev builds (although I use them myself) OR use 0.0.6 and fix the CDEF (there are I think 2-3 CDEF's to update)
garnser
Posts: 9
Joined: Wed Jan 13, 2010 6:10 am

Post by garnser »

I'll give 0.0.6 a try instead.
Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests