Monitor Windows via WMI from Cacti on Linux
Moderators: Developers, Moderators
I might have made a template before, looking at your Disk IO template is looks like its using the raw perf data which the percentidle time doesn't look right in, so can I duplicate that template, switch it to perf fomatted data and clear it out and put in PercentIdleTime instead ? Even in the perf formatted data the output from WMI scriptomatic doesn't look right,
PercentDiskReadTime: 0
PercentDiskTime: 0
PercentDiskWriteTime: 0
PercentIdleTime: 0
PercentDiskTime and PercentIdleTime should be opposite of each other I would think, not the same. Thanks,
PercentDiskReadTime: 0
PercentDiskTime: 0
PercentDiskWriteTime: 0
PercentIdleTime: 0
PercentDiskTime and PercentIdleTime should be opposite of each other I would think, not the same. Thanks,
I've not used those counters before but I tend to try and use RAW data rather than formatted. Mainly because using the RAW data gives better results for things like disk i/o etc.
With that said, you need to understand how those counters generate the data your requesting.
In the case of percent items you'd need a CDEF.
You should still be able to use the formatted data option though, although some versions of the linux wmi client can't handle it properly (mainly the common ones like the debian package or earlier versions).
But yer you could just use the existing templates and mod to use formatted data. Just make sure to use the correct rrd data type so its stored properly.
With that said, you need to understand how those counters generate the data your requesting.
In the case of percent items you'd need a CDEF.
This way the raw values are stored rather than the rounded percentage only.PercentDiskReadTime
Data type: uint64
Access type: Read-only
Qualifiers: CounterType(542573824), DefaultScale(0), PerfDetail(100)
Percentage of elapsed time that the selected disk drive is busy servicing read requests.
For more information about using uint64 values in scripts, see Scripting in WMI.
PercentDiskReadTime_Base
Data type: uint64
Access type: Read-only
Qualifiers: CounterType(1073939712), DefaultScale(0), PerfDetail(100)
Base value for PercentDiskReadTime.
For more information about using uint64 values in scripts, see Scripting in WMI.
You should still be able to use the formatted data option though, although some versions of the linux wmi client can't handle it properly (mainly the common ones like the debian package or earlier versions).
But yer you could just use the existing templates and mod to use formatted data. Just make sure to use the correct rrd data type so its stored properly.
Probably easit via example
You would query the following two counters
* PercentDiskReadTime_Base
* PercentDiskReadTime
Build your graph and pull in both but leave the _Base as a hidden line or element etc. Then use a CDEF to work out the percentage which is simply the PercentDiskReadTime / PercentDiskReadTime_Base * 100
That *should* be all there is to it. But best to check the MSDN details to get the correct formula's
You would query the following two counters
* PercentDiskReadTime_Base
* PercentDiskReadTime
Build your graph and pull in both but leave the _Base as a hidden line or element etc. Then use a CDEF to work out the percentage which is simply the PercentDiskReadTime / PercentDiskReadTime_Base * 100
That *should* be all there is to it. But best to check the MSDN details to get the correct formula's
I have database size and log file size monitoring working fine with MS SQL 2005 full, but can't figure out for the life of me which WMI classes to use to get the same data for MSSQL 2005 Express.
\root\CIMV2\Win32_PerfRawData_MSSQLInstanceName_MSSQLInstanceNameBufferManager etc. aren't used with the Express version?
\root\CIMV2\Win32_PerfRawData_MSSQLInstanceName_MSSQLInstanceNameBufferManager etc. aren't used with the Express version?
Do they exist? Could be a limitation of the express version. I assume you've tried all the wmiadap /f type stuff to reinitialize it. Are those counters available via Perfmon itself?stormonts wrote:I have database size and log file size monitoring working fine with MS SQL 2005 full, but can't figure out for the life of me which WMI classes to use to get the same data for MSSQL 2005 Express.
\root\CIMV2\Win32_PerfRawData_MSSQLInstanceName_MSSQLInstanceNameBufferManager etc. aren't used with the Express version?
CDEF update
I am having what appears to be the same problem - can you give me some direction on how I would go about updating the CDEF???claymen wrote:Ahh the CDEF is wrong. I've seen this before when moving between Cacti 0.7.8 and 0.7.8b.
You'll need to update the CDEF to suit as it normally is used to calculate one of the memory values. From off the top of my head it'l need to be updated to take the available bytes from the total memory to work out the currently used memory. Update your CDEF to suit it and you should be sweet.
Here is the debug from my graph..
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Gadmsanapp2 - Available Disk Space" \
--rigid \
--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: \
CDEF:cdefe=a,a,- \
AREA:#002A97FF:"Total\:" \
GPRINT::LAST:"Current\:%8.2lf %s" \
GPRINT::AVERAGE:"Average\:%8.2lf %s" \
GPRINT::MAX:"Maximum\:%8.2lf %s\n" \
AREA:cdefe#F51D30FF:"Used\:" \
GPRINT:cdefe:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
COMMENT:" Free\:" \
GPRINT::LAST:"Current\:%8.2lf %s" \
GPRINT::AVERAGE:"Average\:%8.2lf %s" \
GPRINT::MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:
ERROR: invalid rpn expression in: a,a,-
Re: CDEF update
Read back through the thread, it's documented a heap of times. However your rpn expression seems really really broken if it's trying to take the same value away from itself...jspell wrote:I am having what appears to be the same problem - can you give me some direction on how I would go about updating the CDEF???claymen wrote:Ahh the CDEF is wrong. I've seen this before when moving between Cacti 0.7.8 and 0.7.8b.
You'll need to update the CDEF to suit as it normally is used to calculate one of the memory values. From off the top of my head it'l need to be updated to take the available bytes from the total memory to work out the currently used memory. Update your CDEF to suit it and you should be sweet.
Here is the debug from my graph..
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Gadmsanapp2 - Available Disk Space" \
--rigid \
--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: \
CDEF:cdefe=a,a,- \
AREA:#002A97FF:"Total\:" \
GPRINT::LAST:"Current\:%8.2lf %s" \
GPRINT::AVERAGE:"Average\:%8.2lf %s" \
GPRINT::MAX:"Maximum\:%8.2lf %s\n" \
AREA:cdefe#F51D30FF:"Used\:" \
GPRINT:cdefe:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
COMMENT:" Free\:" \
GPRINT::LAST:"Current\:%8.2lf %s" \
GPRINT::AVERAGE:"Average\:%8.2lf %s" \
GPRINT::MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:
ERROR: invalid rpn expression in: a,a,-
Hi all, having a prob with the Disk I/O template, ive done well up to now, got quite a few graphs working, but this one says no unfortunately, so im looking for a little help.
First up, im running cacti 0.8.7d on Ubuntu 8.04 Server.
Heres the poller cache,
Running the above gives me the following output:
But then if i run the following wmic command:
I get the following:
Personally i dont understand where all the '''' come from in the wmic output ! Any help would be appreciated
If you can go easy on me too, its my first post
Thanks
First up, im running cacti 0.8.7d on Ubuntu 8.04 Server.
Heres the poller cache,
Code: Select all
/usr/bin/php -q /var/www/cacti/scripts/wmi.php -h \'10.60.100.11\' -u \'/etc/cacti/cactiwmi.pw\' -w \'Win32_PerfRawData_PerfDisk_LogicalDisk\' -n \'\' -k \'Name\' -v \'F:\' -c \'DiskWritesPersec,DiskWriteBytesPersec,DiskReadsPersec,DiskReadBytesPersec,CurrentDiskQueueLength\'
RRD: /var/www/cacti/rra/valleydc01_writespersec_79.rrd
Code: Select all
NTSTATUS: NT code 0xc004100e - NT code 0xc004100e
Return code non-zero, debug mode enabled!
/usr/bin/wmic --namespace=''\'''\''' --authentication-file='/etc/cacti/cactiwmi.pw' //'10.60.100.11' "SELECT 'DiskWritesPersec,DiskWriteBytesPersec,DiskReadsPersec,DiskReadBytesPersec,CurrentDiskQueueLength' FROM 'Win32_PerfRawData_PerfDisk_LogicalDisk' WHERE 'Name'=''''F:''''"
Exec Status: 1
Code: Select all
wmic -U domain/adminuser%pass //server "select DiskWritesPersec,DiskWriteBytesPersec,DiskReadsPersec,DiskReadBytesPersec,CurrentDiskQueueLength from Win32_PerfRawData_PerfDisk_LogicalDisk WHERE Name='F:'"
Code: Select all
CLASS: Win32_PerfRawData_PerfDisk_LogicalDisk
CurrentDiskQueueLength|DiskReadBytesPersec|DiskReadsPersec|DiskWriteBytesPersec|DiskWritesPersec|Name
0|463381992448|12410206|5321132032|486821|F:
If you can go easy on me too, its my first post
Thanks
Bummer, heres the RRD output: any use? Getting an error with that
Cheers
Code: Select all
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="VALLEYDC01 - Disk I/O" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Operations Per Sec" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/valleydc01_readbytespersec_80.rrd":ReadsPersec:AVERAGE \
DEF:b="/var/www/cacti/rra/valleydc01_readbytespersec_80.rrd":WritesPersec:AVERAGE \
DEF:c="/var/www/cacti/rra/valleydc01_readbytespersec_80.rrd":QueueLength:AVERAGE \
CDEF:cdefa=a,e,+ \
AREA:cdefa#BCBEB3FF:"Total\:" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:a#FF0000FF:"Read\:" \
GPRINT:a:LAST:" Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:b#002A97FF:"Write\:" \
GPRINT:b:LAST:" Current\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" \
LINE1:c#000000FF:"Queue Length\:" \
GPRINT:c:LAST:"Current\:%8.2lf %s" \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:c:MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:
ERROR: invalid rpn expression in: a,e,+
Who is online
Users browsing this forum: No registered users and 1 guest