This is for upgrading to Unnoc 1.0.10.1 2007-07-11 http://unnoc.org This is for upgrading to Unnoc 1.0.10.1 from versions 1.0.1 through 1.0.6.2 Pay close attention to which steps go with which versions, you can skip some steps depending on what version you're upgrading from. Total upgrade time is anywhere from 2-10 minutes from start to finish. See the README.root file for instructions on changing to a non-priviledged user. See the README.daemon file for instructions on changing to daemon mode. ----------------------- - Upgrade Instructions ----------------------- See the README.root file for changing to a non-priviledged user See the README.daemon file also for the daemon mode If you wish to install the daemon mode, copy the init.d/ script for your OS/distribution. If it does not exist, please consider contributing one. 1. First untar the tar.gz file (you've already done this) # tar xzf unnoc-1.0.10.1.tar.gz 2. Check perl modules Check to make sure that you have all of the required perl modules, it's possible that new modules have been added, ore are required by the newest version. # ./perl-module-checker.pl Install any missing perl modules (note, some of the plugin modules might not apply to your installation, if you do not plan on using a missing module, then move to the next step). 3. Next upgrade the config file The config file format has changed as of 1.0.6, so this step is VERY IMPORTANT. The script will write the new config file to STDOUT. Run the upgrade config script, redirect output to new config file location (do NOT make it the same location as your current config file, that would result in all options being reset!) Syntax is: upgrade-config.pl /unnoc/location/ untarred/unnoc-1.0.10.1/ So if you were to assume that the webroot is "/var/www/unnoc" and the untarred unnoc directory is the current directory, then: # upgrade/upgrade-config.pl /var/www/unnoc ./ > /tmp/new.conf This will update to the new version of the config file. The config file has completely changed, everything is on a per host basis now, see the README.config docs for all syntax and available options. Take a look at the example unnoc.conf file provided in the examples/ directory for examples on what you can do and what you can't do. --------------------------------------------------------------- Stop now, take a look at your config file and correct any mistakes. MUCH has changed since the older versions. The upgrader will do it's best to upgrade the config file, however it's difficult to account for every combination, so make sure that you make sure that your config file is good BEFORE you proceed to the next steps. Very important!! Just make sure that each host has the proper 'type' value, otherwise the scripts below simply won't work. See the docs for more configuration options and information. 4. Comment unnoc out of the /etc/crontab tab (recommended) Although it won't hurt anything if you skip this step, it will just cut down on errors. NOTE: If you're upgrading from previous versions that didn't have 'unnoc-cron.pl', then you'll want to remove all instances of unnoc from the crontab and install one line that reads: * * * * * root /var/www/unnoc/bin/unnoc-cron.pl /var/www/unnoc Adjusting the pathnames accordingly 5. Upgrade your installation Run the upgrade.sh file located in the unnoc-1.0.10.1/ directory, this will update all of the files. Much has changed since 1.0.6, so the structure is quite a bit differet. If you've made any development changes to any of the files in lib/ or bin/ then back them up. Otherwise, you're fine to just run the upgrade script: # ./upgrade.sh /location/of/unnoc/ The script will also "intelligently" merge your existing graph_colors.conf with the new graph_colors.conf file. The old file will be renamed graph_colors.conf.previous NOTE: this will overwrite any development changes that you've made!!! All files in the lib/, libexec/, plugins/ and bin/ directory will be overwritten completely. 6. Mysql upgrade Start from whichever version you are upgrading from, all DB files should be done in order. So if you are upgrading from 1.0.4, you should apply the 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9 SQL files This will bring your SQL tables up to date # mysql unnoc -p < upgrade/upgrade.1.0.2-1.0.3.sql # mysql unnoc -p < upgrade/upgrade.1.0.3-1.0.4.sql # mysql unnoc -p < upgrade/upgrade.1.0.4-1.0.5.sql # mysql unnoc -p < upgrade/upgrade.1.0.5-1.0.6.sql # mysql unnoc -p < upgrade/upgrade.1.0.6-1.0.7.sql # mysql unnoc -p < upgrade/upgrade.1.0.7-1.0.8.sql # mysql unnoc -p < upgrade/upgrade.1.0.8-1.0.9.sql # mysql unnoc -p < upgrade/upgrade.1.0.9-1.0.10.sql If you are upgrading from a really old version, then you can just drop the database and then re-read in the brand new MySQL file: # mysql unnoc mysql> drop database unnoc; mysql> exit # mysql unnoc < mysql_table This might be easier in some cases 7. Proc update RRD files (from 1.0.6.x and previous) If you're upgrading from ANY version, you must update the process RRD files. The reason is the rrd file structure changed in 1.0.8 (cpu/mem can now be monitored and graphed on a per process basis). The upgrade process is very easy, simply run the provided script in the upgrade directory and you are done. # upgrade/proc-rrd-fix.pl /var/www/unnoc > /tmp/output 2>&1 The script expects to find the 'find' command in /usr/bin/find and expects to find 'basename' in /usr/bin/basename also. Update these path names if they are not found here. The script can take anywhere from 30 seconds to 2 minutes, depending on how many RRD files you have. On a P4 3.2Ghz machine, it can get through 500 RRD files in about 1 minute. So your times may vary. All of the output will be located in /tmp/output. 8. Update UPS RRD files (from 1.0.6.x ONLY) If you're upgrading from 1.0.6 AND you have an APC Smart-UPS that is being monitored by unnoc, then you need to update the RRD's. There's two data sources that were added to RRD, the way to upgrade is like this (assuming that /var/www/unnoc is the place where unnoc is located): First, make sure that you are root. Next, run the following command: # upgrade/ups-rrd-fix.pl /var/www/unnoc It will tell you if it fails, otherwise it will say complete. ########################################################################## If you're upgrading from 1.0.6.x, then you can skip steps 9, 10, 11 and 12 ########################################################################## 9. Update RRD files (from 1.0.4 ONLY) If you're upgrading from 1.0.4 ONLY, do this step: ***************************************************************** NOTE: This step is ONLY required if you are upgrading from 1.0.4. Initial RRD support was added in 1.0.4 and the RRD's weren't created with the proper values, they were fixed in 1.0.5 and they didn't exist in anything previos to 1.0.4 SKIP THIS STEP IF YOU ARE UPGRADING FROM ANYTHING EXCEPT 1.0.4 ***************************************************************** There are a few modifications that need to be done to the RRD files BEFORE you run the mrtg2rrd.pl script. Some of the limits need to be removed and expanded. See the UPGRADE.rrdtuning if you're interested in why this has to be done. In a nut shell, it will make the graphs accurate and correct. stats-rrd-fix.sh will take the longest to run, but shouldn't be too bad. First, run the stats-rrd-fix.sh script, like this (assuming that your webroot is /var/www/unnoc): # upgrade/stats-rrd-fix.sh /var/www/unnoc Next, run the stats-rrdtune.pl, in the same way: # upgrade/stats-rrdtune.pl /var/www/unnoc 10. Fix the RRD directory structure (for 1.0.4 and 1.0.5 ONLY) ***************************************************************** NOTE: this step is for upgrading from 1.0.4 and 1.0.5 ONLY, the RRD directory strucutre changed in 1.0.6, however it didn't exist in 1.0.2 or 1.0.3. SKIP THIS STEP IF YOU ARE UPGRADING FROM ANYTHING EXCEPT 1.0.4 OR 1.0.5 ***************************************************************** In 1.0.6, to make things simpler for the future, I've moved the rrd/servers and rrd/devices directories to just simply rrd/. This means that RRD doesn't care whether or not it's a "server" or a "device". This makes things 10x more flexible as we can include memory usage on switches, for instance, and not have to write a new library for it.. just reuse the same code. You can upgrade your rrd/ directory in two ways: manually or via my script. Manual: # cd /var/www/unnoc # cd rrd/ # mv rrd/servers/* . # mv rrd/devices/* . And that's it. Script: Or you can use my script: (must be root) # upgrade/stats-fix-rrd-structure.pl /var/www/unnoc My script basically does the same thing, just with some error checking and stuff. The only place where you might run into problems is if you've placed a netapp in the stats[] array, if that's the case, then you'll just have to manually copy some things after the script is done 11. MRTG conversion to RRD (for 1.0.4 and 1.0.5 ONLY) *** VERY IMPORTANT *** * * Make sure that you've upgraded your config file and actually * examined it first BEFORE you run these scripts!! These * scripts will not work with older config files, you must have * an up-to-date config file. Make sure that every host * definition has the proper type. * *** VERY IMPORTANT *** If you're config file is up to date, then we're ready to convert from MRTG to RRD. ------------------------------------------------------------ Servers: ************************************************************ NOTE: This step is for 1.0.4 ONLY, if you're upgrading from 1.0.5 then you've already run this. The upgrade/stats-mrtg2rrd.pl script is for upgrading everything in the old stats[] array, now it will update everything listed as 'type = server'. Takes one argument which is webroot: # upgrade/stats-mrtg2rrd.pl /var/www/unnoc For servers, memory usage could not be converted, because I'm storing it in a different way in the RRD's. The MRTG graph was a "free memory" and the RRD is a "memory usage." I personally thought that the MRTG memory graph was useless. If you would like to convert your old memory MRTG files to RRD, let me know and I'll tell you how to do it. ************************************************************ ------------------------------------------------------------ Hosts: The upgrade/hosts-mrtg2.pl script is for upgrading everything in the hold hosts[] array, now it will update everything that is listed as 'type = generic'. Takes one argument, which is webroot: # upgrade/hosts-mrtg2rrd.pl /var/www/unnoc The script will only convert traffic graphs. ------------------------------------------------------------ Plugins: The upgrade/plugins-mrtg2rrd.pl script is for upgrading everything else, this includes: aironets, airports, netapps, apcs and em01 websensors: # upgrade/plugins-mrtg2rrd.pl /var/www/unnoc ------------------------------------------------------------ That should do it for MRTG to RRD. Make sure that everything looks good. Once you've determined that all of the conversions were successful, then you can safely remove the mrtg/ directory. 12. Update your index.php file (for 1.0.3, 1.0.4 and 1.0.5 ONLY) I've added three new functions to help auto-generate links from the index.php page, they are print_href_type, print_href_group and print_href_host. See the README.index for more information. Basically you'll want to look at the functions: print_href_type() print_href_group() print_href_host() Also take a look at all of the example index-*.php files and the main index.php file that ships with unnoc. 13. If you are using the crontab method, then simply uncomment unnoc from the crontab and you're done. If you are switching to the daemon mode, then you can start the daemon with whichever method you use: # /etc/init.d/unnocd start OR # svc -u /service/unnod NOTE: if you click on your new index file or on a particular host and no graphs show up, wait for the cronjob to run. Most graphs and data relies on information stored in the database, so either run the scripts separately, run the unnoc-cron.pl, or just be patient for a couple of minutes and let everything get read in. If after 5 minutes you don't see any results, re-read the UPGRADE instructions, go over your unnoc.conf file make sure it looks good, and take a look at the doc/README.* files. That's pretty much it, take a look at the doc/README.* files for more information. vim:tw=72:wm=1