I have been working for several days now to create a graph template (using WMI) for my Windows servers. I have used examples from the forum.
The graph only display 1 output (free space). I would like the graph to display 2 outputs (free space and total size).
I cannot figure out what I am doing wrong.
The following is an excerpt from the debug log for the relevant host.
10/12/2005 09:45:53 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php-win.exe, ARGS: -q c:/cacti/poller_export.php]
10/12/2005 09:45:53 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php-win.exe, ARGS: -q c:/cacti/poller_commands.php]
10/12/2005 09:45:53 AM - SYSTEM STATS: Time:3.2746 Method:cmd.php Processes:1 Threads:N/A Hosts:5 HostsPerProcess:5 DataSources:61 RRDsProcessed:40
10/12/2005 09:45:53 AM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool/rrdtool.exe update c:\cacti\rra\gtglalafav01_windowscpu_102.rrd --template windowscpu 1129128349:19
10/12/2005 09:45:53 AM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool/rrdtool.exe update c:\cacti\rra\gtglalafav01_winmempagefaults_117.rrd --template winmempagefaults 1129128349:1418
10/12/2005 09:45:53 AM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool/rrdtool.exe update c:\cacti\rra\gtglalafav01_winmeminstalled_116.rrd --template winmeminstalled 1129128349:490964
10/12/2005 09:45:53 AM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool/rrdtool.exe update c:\cacti\rra\gtglalafav01_winmemavailable_114.rrd --template winmemavailable 1129128349:136716288
10/12/2005 09:45:53 AM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool/rrdtool.exe update c:\cacti\rra\gtglalafav01_winmemcacheresident_115.rrd --template winmemcacheresident 1129128349:75227136
10/12/2005 09:45:53 AM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool/rrdtool.exe update c:\cacti\rra\gtglalafav01_wmilhddtotal_119.rrd --template wmilhddfree:wmilhddtotal 1129128349:33282674688:40007729152
10/12/2005 09:45:52 AM - CMDPHP: Poller[0] Time: 2.7066 s, Theads: N/A, Hosts: 4
10/12/2005 09:45:52 AM - PHPSVR: Poller[0] DEBUG: PHP Script Server Shutdown request received, exiting
10/12/2005 09:45:52 AM - CMDPHP: Poller[0] Host[6] DS[119] CMD: c:\perl\bin\perl.exe c:\cacti\scripts\w32_query_logicaldisk.pl 192.168.0.7 get FreeSpace C:, output: 33282674688
10/12/2005 09:45:52 AM - CMDPHP: Poller[0] Host[6] DS[115] SNMP: v1: 192.168.0.7, dsname: winmemcacheresident, oid: .1.3.6.1.4.1.9600.1.1.2.14.0, output: 75227136
10/12/2005 09:45:52 AM - CMDPHP: Poller[0] Host[6] DS[114] SNMP: v1: 192.168.0.7, dsname: winmemavailable, oid: .1.3.6.1.4.1.9600.1.1.2.1.0, output: 136716288
10/12/2005 09:45:52 AM - CMDPHP: Poller[0] Host[6] DS[116] SNMP: v1: 192.168.0.7, dsname: winmeminstalled, oid: .1.3.6.1.2.1.25.2.2.0, output: 490964
10/12/2005 09:45:52 AM - CMDPHP: Poller[0] Host[6] DS[117] SNMP: v1: 192.168.0.7, dsname: winmempagefaults, oid: .1.3.6.1.4.1.9600.1.1.2.7.0, output: 1418
10/12/2005 09:45:52 AM - CMDPHP: Poller[0] Host[6] DS[102] SNMP: v1: 192.168.0.7, dsname: windowscpu, oid: .1.3.6.1.4.1.9600.1.1.5.1.5.1.48, output: 19
10/12/2005 09:45:52 AM - CMDPHP: Poller[0] Host[6] DS[119] CMD: c:\perl\bin\perl.exe c:\cacti\scripts\w32_query_logicaldisk.pl 192.168.0.7 get Size C:, output: 40007729152
10/12/2005 09:45:51 AM - CMDPHP: Poller[0] Host[6] RECACHE: Processing 2 items in the auto reindex cache for '192.168.0.7'.
10/12/2005 09:45:51 AM - CMDPHP: Poller[0] Host[6] SNMP: Host responded to SNMP
10/12/2005 09:45:50 AM - CMDPHP: Poller[0] PHP Script Server Started Properly
10/12/2005 09:45:50 AM - PHPSVR: Poller[0] PHP Script Server has Started - Parent is cmd
10/12/2005 09:45:50 AM - PHPSVR: Poller[0] DEBUG: FILENM: c:\cacti\script_server.php
10/12/2005 09:45:50 AM - PHPSVR: Poller[0] DEBUG: DIRNAM: c:/cacti
10/12/2005 09:45:50 AM - PHPSVR: Poller[0] DEBUG: GETCWD: c:/cacti
10/12/2005 09:45:50 AM - PHPSVR: Poller[0] DEBUG: SERVER: cmd
10/12/2005 09:45:49 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: c:/php/php-win.exe, ARGS: -q c:/cacti/cmd.php 0 6]
Data Query With WMI Script & Multiple Data Source Items
Moderators: Developers, Moderators
Data Query With WMI Script & Multiple Data Source Items
- Attachments
-
- cacti_graph_template_wmi_logical_disk_utilization.xml
- Graph Template
- (10.23 KiB) Downloaded 107 times
-
- W32_LogicalDisk.xml
- Data Query XML
- (1016 Bytes) Downloaded 122 times
-
- w32_query_LogicalDisk.pl.txt
- Perl Script
- (5.88 KiB) Downloaded 329 times
1) your disk disktemplate is wrong. You've specified that it returns both Available Bytes and Total Bytes in one shot. Looking at its output, it does not. I'd modify the perl script so it returns both values in one shot, instead of running two separate queries (it also speeds things up).
2) Once you've modified your script, then you'll need to modify the data template you've created to include the fields added.
2) Once you've modified your script, then you'll need to modify the data template you've created to include the fields added.
| 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 |
Unfortunately for me, I am not very good (no good at all actually) with Perl.
I am also not sure I completely follow what you are saying.
The script (from the command line) will pull multiple values in one shot. I noticed in the debug logs that two queries were listed (one for size and one for freespace). Are you saying this should be 1 query that has both size and freespace? Is it possible to tell Cacti to pull both values at once since the script can handle it?
I am sure one of these hours the lightbulb over my head is going to come on, but for now I am soooo confused.
I am also not sure I completely follow what you are saying.
The script (from the command line) will pull multiple values in one shot. I noticed in the debug logs that two queries were listed (one for size and one for freespace). Are you saying this should be 1 query that has both size and freespace? Is it possible to tell Cacti to pull both values at once since the script can handle it?
I am sure one of these hours the lightbulb over my head is going to come on, but for now I am soooo confused.
Yes.jjcce wrote:Are you saying this should be 1 query that has both size and freespace? Is it possible to tell Cacti to pull both values at once since the script can handle it?
Although, I'm not sure why you want to write a script that polls the disk usage, when there already is one that comes with cacti that does this via SNMP.
| 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 |
Who is online
Users browsing this forum: No registered users and 0 guests