Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
So, i created a script_query to graph information about pagefiles of windows box using wmic.
When I run the ./spine at the linux server, the outpu is ok.
10/15/2008 09:06:47 AM - SPINE: Poller[0] Host[3] DS[28] SCRIPT: perl /usr/local/apache2-2.2.9/htdocs/cacti/scripts/myscripts/query_wmi_pagefile.pl serverName get Used C:pagefile.sys, output: 42
But when i look for the Cactis log I have some errors like that:
10/15/2008 09:15:03 AM - SPINE: Poller[0] Host[3] DS[29] WARNING: Result from SCRIPT not valid. Partial Result: ...
10/15/2008 09:15:03 AM - SPINE: Poller[0] Host[3] ERROR: Empty result [serverName]: 'perl /usr/local/apache2-2.2.9/htdocs/cacti/scripts/myscripts/query_wmi_pagefile.pl serverName get Used E:pagefile.sys'
Trying to use cmd.php:
10/15/2008 09:25:06 AM - CMDPHP: Poller[0] Host[3] DS[29] WARNING: Result from CMD not valid. Partial Result:
10/15/2008 09:25:05 AM - CMDPHP: Poller[0] Host[3] DS[29] CMD: perl /usr/local/apache2-2.2.9/htdocs/cacti/scripts/myscripts/query_wmi_pagefile.pl serverName get Size E:pagefile.sys, output: U
When I run the
perl /usr/local/apache2-2.2.9/htdocs/cacti/scripts/myscripts/query_wmi_pagefile.pl serverName get Size E:pagefile.sys
at my linux Server, the results are ok.
Tried to use escape caracters "\" in the input ID that was passed to the data query (C\:pagefile\.sys) but doesn't work!
<interfaces>
<name>Get Windows PageFile</name>
<description>Queries a Windows Server for a list of pagefiles via WMI.</description>
<script_path>/usr/bin/perl |path_cacti|/scripts/myscripts/query_wmi_pagefile.pl</script_path>
<arg_prepend>|host_hostname|</arg_prepend>
<arg_index>index</arg_index>
<arg_query>query</arg_query>
<arg_get>get</arg_get>
<output_delimeter>;</output_delimeter>
<index_order>ID</index_order>
<index_order_type>alphabetic</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
Change the script pl to not return special caracters... Like that:
10/15/2008 11:15:06 AM - SPINE: Poller[0] Host[5] ERROR: Empty result [bms601]: '/usr/bin/perl /usr/local/apache2-2.2.9/htdocs/cacti/scripts/myscripts/query_wmi_pagefile.pl serverName get Size Epagefilesys'
10/15/2008 11:15:06 AM - SPINE: Poller[0] Host[5] DS[38] SCRIPT: /usr/bin/perl /usr/local/apache2-2.2.9/htdocs/cacti/scripts/myscripts/query_wmi_pagefile.pl serverName get Used Epagefilesys, output: U
I'm running the script at cactiuser without errors. See:
cactiuser@linux:/usr/local/apache2/htdocs/cacti/scripts/myscripts> /usr/bin/perl /usr/local/apache2-2.2.9/htdocs/cacti/scripts/myscripts/query_wmi_pagefile.pl serverName get Size C:pagefile.sys
50
Also, executed ./spine with cactiuser:
10/15/2008 02:16:13 PM - SPINE: Poller[0] Host[3] DS[49] SCRIPT: /usr/bin/perl /usr/local/apache2-2.2.9/htdocs/cacti/scripts/myscripts/query_wmi_pagefile.pl serverName get Used C:pagefile.sys, output: 41
I created an script more simple to query number of process then created a data input method... I`m surprise because i get the same error! So, i think that the problem is not my data query...
Could scripts had an special attribute? That is my folder that contain my scripts:
drwxr-xr-x 2 root root 128 Oct 15 14:00 .
drwxr-xr-x 3 root root 760 Oct 14 17:01 ..
-rw-r--r-- 1 root root 9469 Oct 15 12:42 query_wmi_pagefile.pl
-rw-r--r-- 1 root root 771 Oct 15 14:00 query_wmi_process.pl