Yes, yes, we could add plugins to our Cacti, but before doing that, we need to add this thing called PIA. What is PIA? Well if you're Indonesian, or have been to indonesia, you probably know this thing called bakPIA. What? Never heard of it? Well what the heck are you doing?! GOOGLE THAT MADAFAKA!
Here, this is bakPIA
Now, PIA is Plugin Architecture. The name itself is self explanatory so I wouldn't explain it too much. Now then, let's just continue to install the architecture. Oh yeah, it's highly recommended that you install it right away after you've installed Cacti, since to install the PIA, we need the files to be clean, untouched by your dirty thoughts. That's right, I know what kind of people who come here so behave, alright?
And just like before, this step is used for Ubuntu 12.04.
First, download the cacti PIA. And as always, google it. After that, extract it anywhere you like, but not inside 'kay? *wink wink*. Now get inside the extraction folder, inside it there's a patch file like this : cacti-plugin-arch.diff ; a file folder, a pa.sql, and one other thing that I forgot but not used.
Now, to install the PIA, we just need to patch the Cacti files. To do that, just copy the .diff file to your Cacti installation folder. After that, run this :
patch -p1 -N --dry-run < cacti-plugin-arch.diff
Well that command does execute the patching process but it doesn't do shit. You could consider it as a test run to test whether there're errors when we patch it or not. If there's no error, just run the command line again without the --dry-run and it should be done wonderfully. If there's error, that means the files that will be patched have been edited or soiled.
So what do we do? First we back up the files, or even the whole folder if you want to be safe. After that, copy the files (which what I did) that showed error when we test run the patching process. What are we copying? We're copying the pre-patched files inside the file folder inside the extracted folder. Yes, they are kind enough to provide it. After that we need to edit the config.php inside the Cacti folder.
$plugins = array();
Now, add the code above under the database configuration. So, what is that exactly do? If you're familiar with basic programming, you'll understand it. But if you don't, I'll have to leave google to help you *smile*.
Nah, just kidding. As far as I understand it, we create a variable called with plugins which is an array of table. So, if we want to add a plugin, we need to add a command line under it that goes like this :
//$plugins[]='pluginname';
Again, as far as I understand it, the first command include that plugins array of table inside the database, then we add the plugin identification inside the array so the Cacti database can recognize the plugin and it can run the plugin in the website.
After that, import the pa.sql to your cacti database in mysql.
mysql -u root -p cacti < pa.sql
If you did it correctly, the plugin can be found in the website, like this :
After that, import the pa.sql to your cacti database in mysql.
mysql -u root -p cacti < pa.sql
If you did it correctly, the plugin can be found in the website, like this :
Nice isn't it?
Now, if you see the pic above, you could see a new tab and also a new selection in management menu called weathermap. That is a plugin that I will tell you how to install it, hooray!
Installing the plugin in Cacti is quite simple. You just need to download the plugin, extract and move it to the plugins folder inside the cacti installation folder, and add the command line again inside the config.php . After that you go the Cacti website, login with user with plugin management permission, and turn on the plugin in the plugin management menu! Simple right?
To this point, I haven't tried to use the weathermap plugin so that is next in the tutorial backlog, alongside with how to use Cacti - and cactus - like I promised before. So, stay tune! Oh, and for you guys who were wondering where the heck is the randomness of this blog, worry not friends! I publish fun stuff on weekend and holiday, where I have a lot of time to waste! Yay!
On workdays, I'll mostly post about tutorials IF there is something worth to post to. If not, random post it is then! Until then, stay tuned to this blog!
references : http://docs.cacti.net/manual:087:1_installation.9_pia , google images, my own cactus


No comments:
Post a Comment
I want to start flame war on the comment section pl0x