cacti on windows using wamp a1
TRANSCRIPT
CACTI INSTALLATION GUIDE ON WINDOWS 2000 Rev. A1 By Uus Noviardi (2008-11-04)
Contents 1 Overview .......................................................................3 2 Requirements ...............................................................3 3 Installing WAMP 2.0c ...................................................3 4 Installing Net-SNMP 5.4.2 ..........................................10 5 Installing RRDTool 1.2.28 ..........................................13 6 Installing Cacti 0.8.7a.................................................15 7 Post-Installation .........................................................17
7.1 Apache setup .................................................17 7.2 MySQL Setup.................................................18 7.2.1 Updating Root password (optional) ................18 7.2.2 Create the MySQL database..........................19 7.2.3 Import the default Cacti database ..................19 7.2.4 Create a MySQL username and password for
Cacti. ..............................................................20 7.3 Cacti Setup.....................................................21 7.3.1 Updating Cacti config file ...............................21 7.3.2 Web installation process ................................21 7.4 Install SNMP Agent on Windows 2000...........25 7.5 Adding graphs for localhost on Cacti..............33 7.6 Installing CRON for windows..........................40
1 Overview This document is a procedure to setup CACTI on a PC/Server with Windows 2000 OS.
2 Requirements The following files are required download to install CACTI:
1 WAMP (Windows Apache MySQL PHP) 2.0c http://www.wampserver.com/en/download.php or http://sourceforge.net/project/showfiles.php?group_id=116092
2 RRDTool 1.2.28 http://www.gknw.net/mirror/rrdtool/rrdtool-1.2.28-bin-w32.zip
3 Net-SNMP 5.4.2-1 http://downloads.sourceforge.net/net-snmp/net-snmp-5.4.2-1.win32.exe?modtime=1222072245&big_mirror=1
4 Cacti for Windows 0.8.7a http://www.cacti.net/downloads/cacti-0.8.7a.zip
5 Cron http://www.kalab.com/freeware/cron/cron.htm
The following files are optional
1 Cactid 0.8.6 http://www.cacti.net/downloads/cactid/packages/Windows/cacti-cactid-0.8.6k.zip
2 Spine 0.8.7a http://www.cacti.net/downloads/spine/packages/Windows/cacti-spine-0.8.7a.zip
3 Installing WAMP 2.0c
Start installing WAMP 2.0c by ‘double-click’ the installation icon, then the setup window will show. Follow the installation step as follow:
After the installation completed then verified by using your browser (ex. IE), put URL http://localhost and page will be shown like this
To verify the PHP you can click the phpinfo() from the homepage.
4 Installing Net-SNMP 5.4.2 Start installing Net-SNMP 5.4.2 by ‘double-click’ the installation icon, then the setup window will show. Follow the installation step as follow:
5 Installing RRDTool 1.2.28 Start installing RRDTool 1.2.28 by extrating the zip file (rrdtool-1.2.28-bin-w32.zip). Here’s the example by using winzip to extract the files.
RRDTool will have directory structure like C:\rrdtool-1.2.28-bin-w32\rrdtool. Then move rrdtool directory up to c:\wamp then remove rrdtool-1.2.28-bin-w32 directory until become structure C:\wamp\rrdtool
Copy font files (*.ttf) from C:\wamp\rrdtool to c:\winnt\fonts by execute the command: C:\wamp\rrdtool>copy *.ttf c:\winnt\fonts Or you can use windows explorer
To verify the rrdtools, execute rrdtool from rrdtool directory as follows:
6 Installing Cacti 0.8.7a Cacti 0.8.7a can be installed by extrating the cacti zip file (cacti-0.8.7a.zip). Here’s the example by using winzip to extract the files.
7 Post-Installation
7.1 Apache setup
Edit apache alias
7.2 MySQL Setup
7.2.1 Updating Root password (optional)
It is recommended to set a password for the root user, but if you don’t want you, you can skip to next step. shell> cd mysql\bin
shell> mysqladmin --user=root password somepassword
shell> mysqladmin --user=root --password reload
7.2.2 Create the MySQL database
Execute command below to create cacti database c:\wamp\bin\mysql\mysql5.0.51b\bin>mysqladmin --user=root --password create cacti
or
7.2.3 Import the default Cacti database Execute command below to create cacti database: c:\wamp\apps\cacti-0.8.7a>c:\wamp\bin\mysql\mysql5.0.51b\bin\mysql --user=root [--password] cacti < cacti.sql
i.sql
7.2.4 Create a MySQL username and password for Cacti.
Execute command below o create a MySQL username & password for cacti: shell> mysql --user=root --password mysql
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
mysql> flush privileges;
If you are running MySQL 4.1 and above, you will need to apply the old password setting in order to authenticate with Cacti. To make this change, stop the MySQL service and add the following to the Start Parameter field. Start it again once it has been added.
--old-password
You will also need to update the cactiuser account with the
old password style. shell> UPDATE mysql.user SET Password = OLD_PASSWORD('cactiuser')
WHERE Host = 'localhost' AND User = 'cactiuser';
mysql> FLUSH PRIVILEGES;
7.3 Cacti Setup
7.3.1 Updating Cacti config file
Edit cacti config file (C:\wamp\apps\cacti-0.8.7a\include\config.php) to reflect MySQL cacti database /* make sure these values refect your actual database/host/user/password */ $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "cactiuser"; $database_port = "3306";
7.3.2 Web installation process Open browser (ex. IE) then put URL http://localhost/cacti . Installation opening page will be shown, then follow all the installation instruction process from the browser.
RRDTool Binary Path: C:/wamp/rrdtool/rrdtool.exe PHP Binary Path: C:/wamp/bin/php/php5.2.6/php.exe snmpwalk Binary Path: C:/wamp/netsnmp/bin/snmpwalk.exe snmpget Binary Path: C:/wamp/netsnmp/bin/snmpget.exe snmpbulkwalk Binary Path: C:/wamp/netsnmp/bin/snmpbulkwalk.exe snmpgetnext Binary Path: C:/wamp/netsnmp/bin/snmpgetnext.exe Cacti Log File Path: C:/wamp/apps/cacti-0.8.7a/log/cacti.log
Login with user/password = admin/admin, then replace with newpassword if necessary.
7.4 Install SNMP Agent on Windows 2000
1 Select Add/Remove Windows Components
1 Setup SNMP Open Services from Control Panel -> Administrative Tools
Verify
Snmpwalk –v2c –c public localhost 1.3.6.1.2.1.2.2.1
7.5 Adding graphs for localhost on Cacti
+ Running data query [1]. + Found type = '3' [snmp query]. + Found data query XML file at 'C:/wamp/apps/cacti-0.8.7a/resource/snmp_queries/interface.xml'+ XML file parsed ok. + Executing SNMP walk for list of indexes @ '.1.3.6.1.2.1.2.2.1.1' + Located input field 'ifIndex' [walk] + Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.1' + Found item [ifIndex='1'] index: 1 [from value] + Found item [ifIndex='2'] index: 2 [from value] + Found item [ifIndex='16777220'] index: 16777220 [from value] + Found item [ifIndex='16777221'] index: 16777221 [from value] + Located input field 'ifOperStatus' [walk] + Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.8' + Found item [ifOperStatus='Up'] index: 1 [from value] + Found item [ifOperStatus='Down'] index: 2 [from value] + Found item [ifOperStatus='Down'] index: 16777220 [from value] + Found item [ifOperStatus='Up'] index: 16777221 [from value] + Located input field 'ifDescr' [walk] + Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.2' + Found item [ifDescr='MS TCP Loopback interface'] index: 1 [from value] + Found item [ifDescr='Bluetooth PAN Driver'] index: 2 [from value] + Found item [ifDescr='Ericsson Virtual Security Adapter'] index: 16777220 [from value] + Found item [ifDescr='Broadcom NetXtreme Gigabit Ethernet Driver'] index: 16777221 [from value] + Located input field 'ifName' [walk] + Executing SNMP walk for data @ '.1.3.6.1.2.1.31.1.1.1.1' + Located input field 'ifAlias' [walk] + Executing SNMP walk for data @ '.1.3.6.1.2.1.31.1.1.1.18' + Located input field 'ifType' [walk] + Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.3' + Found item [ifType='softwareLoopback'] index: 1 [from value] + Found item [ifType='ethernetCsmacd'] index: 2 [from value] + Found item [ifType='ethernetCsmacd'] index: 16777220 [from value] + Found item [ifType='ethernetCsmacd'] index: 16777221 [from value] + Located input field 'ifSpeed' [walk] + Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.5' + Found item [ifSpeed='10000000'] index: 1 [from value] + Found item [ifSpeed='700000'] index: 2 [from value] + Found item [ifSpeed='10000000'] index: 16777220 [from value] + Found item [ifSpeed='100000000'] index: 16777221 [from value] + Located input field 'ifHwAddr' [walk] + Executing SNMP walk for data @ '.1.3.6.1.2.1.2.2.1.6' + Found item [ifHwAddr=''] index: 1 [from value] + Found item [ifHwAddr='00:16:41:7B:0F:C1'] index: 2 [from value] + Found item [ifHwAddr='00:01:EC:10:10:11'] index: 16777220 [from value] + Found item [ifHwAddr='00:15:60:C4:B2:F4'] index: 16777221 [from value] + Located input field 'ifIP' [walk] + Executing SNMP walk for data @ '.1.3.6.1.2.1.4.20.1.2' + Found item [ifIP='0.0.0.0'] index: 2 [from regexp oid parse] + Found item [ifIP='127.0.0.1'] index: 1 [from regexp oid parse] + Found item [ifIP='150.236.178.142'] index: 16777221 [from regexp oid parse] + Found data query XML file at 'C:/wamp/apps/cacti-0.8.7a/resource/snmp_queries/interface.xml'+ Found data query XML file at 'C:/wamp/apps/cacti-0.8.7a/resource/snmp_queries/interface.xml'+ Found data query XML file at 'C:/wamp/apps/cacti-0.8.7a/resource/snmp_queries/interface.xml'
Perform: Verbose Query or Reload query data for
1. SNMP – Get Mounted Partition 2. SNMP – Get Processor Information 3. SNMP – Interface Statistics
Create Graph for this host
Help is on C:\wamp\apps\cacti-0.8.7a\docs\html\install_windows.html Test cacti poller C:\wamp\apps\cacti-0.8.7a>C:\wamp\bin\php\php5.2.6\php poller.php
Devices -> localhost -> Create Graph for this host Click Data Query right icons (green circle)
Create cacti batch file for poller in C:\cactipoller.bat cd C:\wamp\apps\cacti-0.8.7a C:\wamp\bin\php\php5.2.6\php poller.php
7.6 Installing CRON for windows Execute ntsetup.exe
Install & put to directory C:\wamp\bin
Install crons service, create crontab file on c:\winnt\system32, start cron
To check cron service runner properly or not, execute Shell> type c:\winnt\system32\cron.log