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.
DevilSun please excuse a script fools ignorance but when I try to run your script on my Win2K Cacti server like so:
\Apache\htdocs\cacti\scripts>perl w32_query_OperatingSystem.pl localhost index
I get the following error message back:
Can't locate loadable object for module Win32::OLE in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at w32_query_system.pl line 4
Compilation failed in require at w32_query_system.pl line 4.
BEGIN failed--compilation aborted at w32_query_system.pl line 4.
Now that's interesting...to me that seems like a Perl error, such as it doesn't have the OLE libraries or something. Unfortunately I can't help much with that error, being as this is the first time I've ever used Perl in depth in any environment, let alone on a windows platform.
This is my configuration and I haven't had any problems with it as far as that's concerned:
Win2003 w/ IIS6
Cacti 0.8.6
MySQL 4.0.20a
PHP 4.3.7.7
ActivePerl 5.8.4.810
Really sounds like you are missing a Perl library or two. In my C:\Perl\site\lib directory, I have a Win32 subdirectory with an OLE.pm in it, and also within that, a OLE directory. I'd say it's not recognizing them or they're missing.
The script I posted I know works on Win2003, but probably not many others. It's specifically looking at the "Win32_PerfFormattedData_PerfOS_System" class in \root\cimv2, and looking for "Threads,Processes,SystemCallsPersec,ContextSwitchesPersec".
Hi Devilsun,
The program runs on the command prompt and gives all the outputs after talking to WMI but when I try to graph it using cacti I am getting the following error in the cacti log file.
10/19/2004 03:12:37 PM - CMDPHP: Poller[0] Host[0] CMD: perl C:\Apache2\htdocs\cacti/scripts/w32_query_system.pl, output: U
10/19/2004 03:12:37 PM - CMDPHP: Poller[0] Host[0] WARNING: Result from CMD not valid. Partial Result: Display information
DevilSun I am running the query against a Win2K server and you are correct the WMI query does not work for Win2K.
I have found another script:w32_query_operatingsystem.pl that will run and I can get memory information when I run the script from the command prompt, but it fails to update the rrd thus no data in the graph.
Thanks for the help I'll keep plugging away and maybe I'll get lucky and find a solution that works.
I have tried to import this script into cacti v8.6b and nothing happens when i select save the page refreshes and there is no text stating what has been imported etc. This is also the case with the SQl server script in an earlier post, but havent had any problems importing any other scripts
I haven't been able to use the import file feature for a few versions...it doesn't do anything it seems; however pasting the contents of the file into the text box and importing seems to have always worked for me. Little more work, but at least it works -- I believe it's a cacti 0.8.6x problem that should be fixed soon but am not sure.
I am randomly getting cactid failures and gaps on my graphs after adding this script to about 60 hosts. It seems to runs fine if from the command line, but every few polling cycles I get something like this in my logs:
05/14/2007 10:18:09 AM - CACTID: Poller[0] Host[21] DS[963] WARNING: Result from SCRIPT not valid. Partial Result: ...
05/14/2007 10:18:09 AM - CACTID: Poller[0] Host[21] ERROR: The POPEN timed out
05/14/2007 10:18:09 AM - CACTID: Poller[0] Host[21] ERROR: One or more of the file descriptor sets specified a file descriptor that is not a valid open file descriptor.
Occasionally cactid hangs completely and I have to kill the process. Because the failures are so intermittent I am not sure if the problem is with the script or something else.
Where I can look to get more information about what is happening? I've been trying to find out what the "file descriptor" error means but I haven't had any luck so far.
I'm running Cacti 0.8.6j on Windows with Perl 5 and mysql 5.0.37
I don't know much about the xml errors, but from reading other people's comments I gather that they could happen when you try to import a template that has been created from a newer version. What version of cacti are you running?
FYI- I started noticing more weird issues after I had this script running for a while. In addition to the errors I already posted, MySQL stopped working after another hour or so, reporting "Too many connections" and all sorts of other nasty errors. I had to restart the server and wait about 30 minutes for it to begin working again. I have disabled this script until I have more time to look at it.