[Resolved] Output Help - Get Script Server Data (Indexed)

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

Moderators: Developers, Moderators

Post Reply
d0nni3q
Posts: 19
Joined: Mon Feb 16, 2009 2:26 pm
Location: Pittsburgh, PA

[Resolved] Output Help - Get Script Server Data (Indexed)

Post by d0nni3q »

Hello,

I'm working on an indexed PHP script that will return WMI data. The issue at hand is that only the first call to the script from the PHP Script Server "works". The output below is what happens from CLI...does anyone have an idea what could be causing this?

Code: Select all

PHP Script Server has Started - Parent is cmd
/var/www/html/scripts/wmi_query.php wmi_query 10.0.0.1 25 cactiwmi nictraffic get BytesReceivedPerSec 0
2078530862U
/var/www/html/scripts/wmi_query.php wmi_query 10.0.0.1 25 cactiwmi nictraffic get BytesSentPerSec 0
sh: -U: command not found
U
quit
PHP Script Server Shutdown request received, exiting
TIA

---------------
[Resolved]: "include_once('wmi_config.php');" was the problem. Changed to "include('wmi_config.php');" and the script works as desired.
Attachments
wmi_config.php.txt
PHP Config Script
(268 Bytes) Downloaded 114 times
wmi_query.php.txt
PHP Query Script
(2.61 KiB) Downloaded 112 times
Last edited by d0nni3q on Sun Mar 08, 2009 10:58 pm, edited 1 time in total.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) wrong forum, moving.

2) wrong WMI name, should be BytesTransmittedPerSec. http://msdn.microsoft.com/en-us/library ... S.85).aspx

3) why are you doing expensive WMI calls for interface traffic when SNMP is faster and easier than linux->windows wmi query?
d0nni3q
Posts: 19
Joined: Mon Feb 16, 2009 2:26 pm
Location: Pittsburgh, PA

Post by d0nni3q »

BSOD2600 wrote:1) wrong forum, moving.

2) wrong WMI name, should be BytesTransmittedPerSec. http://msdn.microsoft.com/en-us/library ... S.85).aspx

3) why are you doing expensive WMI calls for interface traffic when SNMP is faster and easier than linux->windows wmi query?
1.) Thanks for pointing that out.

2.) Not necessarily: http://msdn.microsoft.com/en-us/library/aa394340 (uint32 BytesReceivedPerSec; uint32 BytesSentPerSec; uint64 BytesTotalPerSec;)

3.) This is just a simple example. The final script will be for Exchange mailstores where there are N+_Total mailstores. NICs seem to be the common example for indexed queries, thus it would be easy to relate.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests