Windows Memory

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

Moderators: Developers, Moderators

jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

Thanks for the links. I read through them both and ended up doing the following...

1. Opened wmimgmt.msc on the remote server and gave 'cactiserviceaccount@domain' Enable and Remote Access.

2. Opened dcomcnfg.exe on the remote server and allowed 'cactiserviceaccount@domain' access to WMI through DCOM.

Yet it still does not allow 'cactiserviceaccount@domain' to get data. Perhaps I misunderstood the documentation?
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Looks good. You'll need to explicity allow DCOM in the windows firewall too. Port 135.
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

I can open a a telnet session on port 135 but the script still says I'm not allowed to get WMI data.

I double checked the settings but cant see where I missed something.

Is there any other piece that needs to be in place to allow WMI data polling?
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

In dcomcnfg -> DCOM -> COM -> Security. You gave your cactiuser rights in both access permissions and launch & activate permissions?

When you're doing the testing if this is working or not, you're logged on as your Cactiuser when running the script, right?
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

Even after your suggested changes I get the same result...

Yes. I am logged in as the cacti user.

Still cant seem to get the data for some reason.
Last edited by jengstro on Mon Nov 28, 2005 3:23 pm, edited 1 time in total.
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

To be a bit more specific...

The path I followed was... "dcomcnfg -> DCOM Config-> COM+ Event System-> Security".

Added "cactiuser@domain" to "Launch Permissions" and "Access Permissions"

When I run the following command... "perl D:/cacti/scripts/w32_query_logicaldisk.pl hostname get freespace,size C:" the following error is returned... "Unable to talk to WMI for hostname."
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

With security thrown to the side... adding the cactiuser to the local admin group on the remote machines resolved my issue.
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Yea... looking at my setup, thats what I ended up doing too. My cacti is simply for learning/geek purposes so I don't have to really work about security. Maybe I'll look into what needs to be done and create a FAQ about it...
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

That would be cool if you could. The only thing I was able to find was that you have to be a local admin to run a script. Not sure if that matters when your running a query from a remote machine...
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

I ran into a snag with added the cactiuser to the local adminisrators group on the remote machines... domain controllers. :(

Anyone have a secure practice to allow the cactiuser just enough rights to read WMI info on a domain controller?
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Alright, I figured it out and wrote a FAQ: http://bsod2600.home.comcast.net/instal ... s.html#FAQ. I did this on a Windows 2003 computer from XP Pro.
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

Nice! I will have to check the "Edit Limits" setting and see if it fixes my issues. Thanks for adding that section either way!
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

Hello all,

Any idea how I can get rid of the hostname input field? It would be ideal if when you add the graph it just pulled the hostname from the host dynamically.

Thanks.
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
User avatar
rcaston
Cacti User
Posts: 204
Joined: Tue Jan 06, 2004 7:47 pm
Location: US-Dallas, TX
Contact:

odd.. CMDPHP: Poller[0] Host[4] DS

Post by rcaston »

The script works for me when I do it by hand; but for some reason my graphs are all blank;

For some reason the script is returing "U" for the output; even tho when i run it by hand; it returns the values fine...


Log shows the following:

07/13/2006 11:26:07 AM - CMDPHP: Poller[0] Host[4] DS[42] WARNING: Result from CMD not valid. Partial Result: Unable to talk to WM
07/13/2006 11:26:07 AM - CMDPHP: Poller[0] Host[4] DS[42] CMD: perl.exe d:/WWW/cacti/scripts/Lit_W32_OS.pl get MaxProcessMemorySize,TotalVirtualMemorySize,FreeVirtualMemory,TotalVisibleMemorySize,FreePhysicalMemory,SizeStoredInPagingFiles,FreeSpaceInPagingFiles, output: U
07/13/2006 11:26:07 AM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id,rrd_name,time,output) values (42,'','2006-07-13 11:26:00','U')"


If i can do the query by hand (while logged in as the cacti user) and it works, then why would cacti be unable to do it via the scheduled job?
Attachments
blank.gif
blank.gif (568.8 KiB) Viewed 12215 times
laurent
Posts: 13
Joined: Mon Jan 30, 2006 9:58 am

Post by laurent »

I'm having the same issue as some here , the script runs fine from the command prompt but Nan within cacti graphs ,

D:\wwwroot\MRTG\cacti\scripts>perl lit_w32_os.pl 10.x.x.x get MaxProcessMemorySize,TotalVirtualMemorySize,FreeVirtualMemory,TotalVisibleMemorySize,FreePhysicalMemory,SizeStoredInPagingFiles,FreeSpaceInPagingFiles
MaxProcessMemorySize:2097024 TotalVirtualMemorySize:1197636 FreeVirtualMemory:381884 TotalVisibleMemorySize:1441288 FreePhysicalMemory:443572 SizeStoredInPaging
Files:4096000 FreeSpaceInPagingFiles:4033324

I wonder if the issue comes from the fact returned results are not only numbers but description+number

Could anyone shae some light , I'm using Cacti version 0.8.6.h

Thanks for your time
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests