HOWTO: Installing Cacti 0.8.8a on Windows Server 2008

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

Post Reply
wouter
Posts: 4
Joined: Tue Mar 23, 2010 10:57 am

HOWTO: Installing Cacti 0.8.8a on Windows Server 2008

Post by wouter »

I've struggled a long time with installing this, using pieces of documentation and forum posts left and right.
The HOWTO below is not very well written, but basically just slightly improved notes that i took while i was installing.
Nonetheless, i think they will be very useful for anyone trying to install cacti on Windows Server 2008.
I wanted to edit the wiki documentation, but i couldn't figure out how to get an account there, so... here goes:

Documentation
Cacti installation guide
Don't use this, it's very incomplete and outdated, use the community documentation
- http://www.cacti.net/downloads/docs/htm ... ndows.html

Cacti 0.8.8 community documentation windows manual
Use this, it's the most comprehensive manual. It's not specified for what Windows version this manual is intended. It's quite good, but there are a lot of pitfalls, documented in this HOWTO. But use it as the main guideline, i've not duplicated all steps in this HOWTO, just additions/changes to the community manual.
- http://docs.cacti.net/manual:088:1_inst ... er_windows
○ Don't use the "next page" buttons, they do not follow the correct page-order. Use the links in the overview page and go from 1 to 8.

Requirements
The most important pitfall when installin Cacti (on windows) is that the documented requirements are wrong.
Don't trust the manual, you have to pay very close attention to use precisely the correct versions of all the software packages.
I will document what versions i've used. If you plan on using different versions, it's a good idea to google for people reporting bugs with it before you attempt the installation.

- Of course, when installing on a 64bit system, make sure to get the 64bit versions of the installers.
- Cacti doesn't handle paths with spaces well. Don't use them for any of the installed software packages
- If anyone is interested, i can make a bundle of all these packages and put them online somewhere. Let me know.

1. Webserver: IIS 7.5
○ not aware of bugs in any other versions
○ There seemed to be some differences between 7.0 and 7.5 that where not mentioned in the documentation.
2. PHP: 5.2.17
○ Ran into problems with 5.3, and 5.4 is also documented to give issues.
3. MySQL (Community Server): 5.1.68
○ Also read of a user that said 5.1.48 works
○ I suspect the latest version would also work.
4. RRDTool: 1.2.30
○ Net-SNMP needs a very specific version of the C++ 2008 redistributables. Version 1.4.4 of RRDTool does not work with that version, so you will need to fall back to an older version.
5. Microsoft Visual C++ 2008 Redistributables: 9.0.21022
○ Net-SNMP requires -precisely- -this- version.
6. OpenSSL: 0.9.8y
○ Can't use SNMP v3 when using v1.x or higher
7. Net-SNMP: 5.5.0-2
○ Just used the latest version here, i suspect all versions should work
8. Cacti: 0.8.8a
○ latest version available at time of writing.
9. Cygwin/spine
○ Didn't install

Installation steps
Make sure to follow the manual, alongside these comments. Not just the manual, or just the comments.

1. IIS 7.5
Installing IIS 7.5 using the following manual
http://www.iis.net/learn/install/instal ... er-2008-r2

○ Add Role
○ Select IIS
○ Use the default selections, but add CGI

Configurations
http://docs.cacti.net/manual:088:1_inst ... _webserver
The user group for IIS7.5 is called IIS_IUSRS (not IIS_USRS). The "user" is called IUSR (not IUSR_) , but this does not show up in the list of users, but can be used to set permissions. It's not a real user, but a "built-in security principal".
○ If you can not change the permissions on cmd.exe, take ownership first
○ Add the IUSR principal and give it read/execute access to cmd.exe
○ Add the IIS_IUSRS group and give it read/execute access to cmd.exe

Already download cacti now, since you have to set some permissions in this phase
§ Copy the cacti "installer" folder (it's portable, no installer) to C:\inetpub\wwwroot\cacti

○ apply the permissions as mentioned in the manual
○ start/stop the IIS server through serverManager
§ CMD commands in manual don't work for IIS 7.5
§ stop all 3 system services to be sure, and start again

○ Obviously, you don't need to install Apache if you've installed IIS.

2. PHP
I've first tried this with version 5.3.23 and ran into problems when testing with "php -m".
The PHP installer of that version doens't include the "mibs" folders. You might be able to use this latest version, if you manually add the folder. Didn't try that.
http://forums.cacti.net/about36500.html
http://php.net/manual/en/snmp.installation.php

Installing 5.2.17 using the following manual
This version includes the mibs folder.
http://docs.cacti.net/manual:088:1_inst ... figure_php
○ When using IIS, get the Non thread safe MSI installer.
○ Also download the ZIP version. this contains the mibs folder.
○ Run the MSI installer,
§ set path to C:\PHP\
§ select IIS FastCGI
§ Make sure to select the required extentions. Don't simply select all of them, or you will get warnings when testing with "php -m"
§ also select the "Script Executable" (said so in the Cacti installation manual, not sure if needed)
○ Extract the ZIP file and copy the extras\mibs folder to php\extras\mibs.
○ Restart the server (not sure if this is required)
○ set all the folder permissions, create some folders, change the php.ini file
○ Create a windows user "cactipoller" for example, and give him modify rights to c:\php\extras\mibs\.index
§ Add this user to the administrator group
§ In group policy, add this user to the "Run as batch job" policy
§ This is the user you will use later to set up task scheduler

3. MySQL
Install MySQL 5.1.68 Community Server
User reported no problems with MySQL 5.1.48. Trying low version instead of the latest version to prevent compatibility issues.
- http://forums.cacti.net/about38746.html

When looking for the older version, don't use the "MySQL Installer" link, but the MySQL Community Server link. This is the same as the standard version, but in the prior page, you can't download version 5.1.x
○ Using the full MySQL installer, not the "essentials". Don't know if essentials would be sufficient.

Install
○ Do a typical installation
○ Select "configuer the MySQL server now"
○ follow the manual closely (firewall settings, no strict mode...)
○ UTF8 character set (just a habit, could also use Latin)
○ include bin in path, and install as service

4. RRDTool
This was tricky on version, since it's hard to find a compiled version, and it wasn't clear to me what files i did/did not need.

Version 1.4.4 doesn't seem to work with the C++ redistributables version that Net-SNMP needs.
Advice on version
http://forums.cacti.net/viewtopic.php?f=3&t=47263

installing version 1.2.30
○ Download: http://oss.oetiker.ch/rrdtool/pub/?M=D
§ rrdtool-1.2.30-win32-perl510.zip
○ Extract and get the exe file in \data\rrd2\rrdtool-1.2.30\Release
○ Download the windows binaries of version 1.4.4
http://www.thebits.info/general/rrdtool ... es-226.htm
§ Install, and replace the exe with the 1.2.30 version in c:\RRDTool

I'm not sure if you could use the 1.2.30 exe without the DLL's that 1.4.4 installs. This is just how i've hacked trough it, and don't feel like redoing this to test.

5. Microsoft Visual C++ 2008 Redistributables
○ needed for OpenSSL: not sure if you really need this...
○ A very specific version is required! As mentioned on the OpenSSL download page:
- http://www.microsoft.com/en-us/download ... x?id=15336
- vcredist_x64.exe
- "Having problems with error messages when trying to run 64-bit OpenSSL? This will likely fix the problem. Only works with Windows 2003 Server and later. Although there is a "newer version" of this installer, this is the correct version to install."

6. OpenSSL
From Net-SNMP site:
○ "IMPORTANT NOTE FOR WINDOWS USERS: the Net-SNMP Windows binaries have been built with OpenSSL version 0.9.8r. Since the OpenSSL 0.9 and 1.0 DLLs are incompatible, any attempt to install Net-SNMP on a system where OpenSSL 1.0 has been installed will fail."

install version 0.9.8y. NOT v1.x or higher!
Compiled versions can be found here: http://slproweb.com/products/Win32OpenSSL.html
Need this for SNMP v3 support
○ install to c:\OpenSSL
○ Select option to put DLL's in system directory

7. Net-SNMP
Not sure if you need to install this, or what the benifit is. The SNMP service in windows server 2008 works just as well as far as i know.

Following this installation manual. The community manual is lacking some steps.
http://forums.cacti.net/viewtopic.php?t=26151

version 5.5.0-2. This is the latest version for wich binaries are available in 64bit.
http://sourceforge.net/projects/net-snm ... -binaries/
○ select "with windows extention DLL support"
○ You don't need the Net-SNMP Trap service
○ Install to C:\Net-SNMP\

Configuer Net-SNMP (not metioned in the community manual)
○ Run "register as a service" script as administrator
○ Create the snmpd.conf file in c:\net-snmp\etc\snmp\
○ Add the SNMP service feature trough server manager and disable the service
- http://technet.microsoft.com/en-us/libr ... 26987.aspx
- No setting shave to be made, but when you want to experiment with it, you have to close server manager first, then open it again, and check the properties of the "SNMP service". If you don't close/open server manager, you will not get all the tabs in the properties window.
○ start/restart the service

Fix mibs issue
If you get these warnings when using snmpwalk:
Cannot find module (NOTIFICATION-LOG-MIB): At line 1 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 1 in (none)
- http://forums.cacti.net/post-119901.html
§ same issue?

- PHP has a mibs folder, and Net-SNMP has a mibs folder. They have different files, and the PHP mibs folder seems to be incomplete
- When changing the environment variable pointing to the PHP mibs dir to the Net-SNMP one, "php -m" keeps working without errors, and snmpwalk also works without errors
§ C:\Net-SNMP\share\snmp\mibs

Firewall
Add an inbound exception on UDP 161. This is the port the service listens on for SNMP requests

8. Cacti
Patching
Not sure how this is intended to work, just did the replacements manually since there was just one patch.
http://www.cacti.net/downloads/patches/ ... none.patch

Installing
Here the community manual seems to stop.
Browse to http://localhost/cacti and finish the installation
- check the paths
- select the version of RRDTool in use. I've selected 1.4.4, even though i'm using the exe of 1.2, but the dll's of 1.4. Seems to have worked.

set admin password
- for some reason i wasn't presented with a screen to set the admin/guest password. Did it manually throughthe database.
§ connect to MySQL: mysql -u root -p <password>
§ update cacti.user_auth set password=md5('password') where username = 'admin';
§ update cacti.user_auth set password=md5('password') where username = 'guest';
§ (also found a password=Password('password') variant of this online that didn't work)

Set up poller
- create a windows user cactipoller if you didn't already (see step 2 - PHP)
- add to remote desktop users so you can log in with it and test the poller (when working remotely, of course)
- give cactipoller log on as batch job rights
- read here that it's common to make the poller user admin: http://forums.cacti.net/about30650.html
§ it needs modify access to the log and rra directory in cacti
- add the task scheduler task. Set to repead every 5 minutes for 1 day (not 15 minutes as the manual suggests)

Configuering devices/graphs
- in cacti, device list, increasing SNMP timeout to 5000 milliseconds
- windows SNMP replies are quite slow sometimes. If you get timeout warnings in the cacti log file, this is the sollution.
- debug:
§ manually check the OID
§ snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.25.2.3.1.6.2

-1.#J in graphs, or "missing image"
- Should be gone after 10 minutes (2 poller requests)
- you can check the log file and the files in cacti\rra to see if the poller is updating/creating the files

9. Set up clients
To set up monitoring of a client, you just have to do the SNMP step.
Only using the windows SNMP service, and not Net-SNMP also seems to work. Not sure why Net-SNMP is required

10. Spine
From documentation: "Cacti can use cmd.php as a poller, but spine is faster."
You don't -have- to install Spine.
- http://www.cacti.net/spine_info.php
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: HOWTO: Installing Cacti 0.8.8a on Windows Server 2008

Post by BSOD2600 »

1) You do realize the point of http://docs.cacti.net/ is a wiki, so you could help other users by improving the existing documentation... if providing correct information.
2) Any particular reason you didnt want to use http://forums.cacti.net/viewtopic.php?f=3&t=14946 ?
3) php 5.3, mysql 5.5, rrdtool 1.4, net-snmp 5.6 all work just fine on Windows 2008 -- these versions are already included with the above installer. Stay away from the legacy versions you mentioned due to bugs and security issues.
wouter
Posts: 4
Joined: Tue Mar 23, 2010 10:57 am

Re: HOWTO: Installing Cacti 0.8.8a on Windows Server 2008

Post by wouter »

Hey.

I wasn't aware of the packaged installer you created; obviously i would have tried that first if i was.
Nice work on that, thanks. I'll try it next time.

Maybe you can mention it in the documentation?
I wasn't aware of its existence, since i usually don't browse an applications support forum before i start an installation.
Or, i missed it somewhere in the documentation? I just skipped to "Installing on windows".

At the time of writing i overlooked that i needed an account on bugs.cacti to log in to the wiki. I was trying with my forum account.
But yeah, my first intent was to work on the wiki. I'm too lazy to redo it again now. So, here we are :) I'll leave it up to someone else.
And i'm an amateur anyway, so it would be best if it's reviewed by a more experienced user.

About the versions.
Nice to see that it's possible to get the latest versions working. But it doesn't seem to work "out of the box", as i did run into the problems that i mention in my howto.
Like PHP missing the mibs folder, other users reporting issues with MySQL, rrdtool being incompatible with the C++ redestributables that the later version of Net-SNMP needs. I assume you're more experienced, and found ways around this.

But, bottom line. I'll obviously try your packaged version next time :)

Regards,
Wouter
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests