Monday, 30 June 2014

A lil bit configuration with weathermap

Now you have learned how to add plugins to Cacti, some of you might even already mess with its setting and tried to use the editor. But unfortunately, you can't. The weather is missing something to work. Perhaps you need the sun to enable it...

Alright, the first problem you'll encounter is the PHP editor is not enabled. This is quite easy to solve, just go to the weathermap plugin folder in Cacti, edit the editor.config. The solution is right there, just change the value to true.  Keep in mind that enabling the editor ALSO enabling other people to edit your weathermap, I haven't tried to exclude other people from messing with our shit so for now let's just focus on configuring the weathermap editor so it can be used

Next, it will say that some modules of the php is missing or not enabled. If you really REALLY follow the tutorial before blindly, you will realize that you haven't installed the said module. Luckily, it's quite easy to get it in Ubuntu, but before that, you need to check again. First, go to you web browser, then go here :

localhost/[cacti url]/plugins/weathermap/check.php

Now see what is the result. It probably resulted in lots of missing module, but it could be wrong. Now open the terminal, go to the weathermap folder in Cacti, and do this :

php check.php

What is the result? If it is the same as the browser, you seriously need to install the modules. Now go get it with this magic words :

apt-get install php5 php5-cli php5-gd php-pear apache2

Wait for it to be finished downloading. Now do the two steps again, from the browser and from the terminal. Is it still the same? No? Excellent! Probably your browser still show that the module is missing but the terminal showed that all the modules are installed and healthy. For me, I fix it with restarting (or shutting down and leave it for a good few hours) the PC or virtual machine and then voila, it works. If you find another way to fix this problem, feel free to share it.

Now the final hurdle is setting the read/write permission. Just do this on the weathermap folder :

chown -R www-data:www-data /var/www/cacti/plugins/weathermap/configs

And you're all set!

That's quite short isn't it? I was going to fill it with random rant or something but I just remembered I need to play morrowind and the witcher 1. So, I'll keep it short, and I'll see you next time on how to use both cacti and weathermap! Oh and don't forget about cactus too mmkay? We'll get there soon enough...


Tuesday, 24 June 2014

Cactus PIA and the weather

Now, after you installed the Cacti, and probably some of you have been fiddling with its settings and  stuff, it might occur to you that maybe, just maybe, we could add something to make our cactu- I mean Cacti, some extended function. Like, I don't know, some plugins perhaps?

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 :

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

Thursday, 19 June 2014

How to install cactus!

Yeah! My first post about some tutorial! Are you pumped? I AM!

Right, right as you know, cactus is a desert plan. So I guess it's quite easy to take care of it. The problem is how to install them into the pot. Many of you know that their leafs are the needles, and needles can hurt your finger, also there's a chance you'll fall into a deep sleep and won't wake up until some asshole rape you. But you know what? SCREW IT! GRAB THE CACTUS BY HAND AND RAM IT INTO THE POT! that's the only way to install it, like a b0ss.

Look at that, ain't it beautiful?

After you've done the procedure on the first paragraph, you can act proud and show the cactus to your friend! Don't be shy! Show it like it was your own private stick! Make them choke with it! Yeah! 



So, now that you have learned how to install a cactus, now you're ready to install Cacti. Now you might be wondering whether Cacti is cactus's long lost brother or he's a complete stranger who someday will rape you roughly. Well, hold that thought, keep it to yourself, we'll discuss it more after this.

Cacti is actually a software - open source one - that monitor network, well not just network, you can also monitor your memory usage, user usage, load usage, and other things which I haven't tried yet. But don't worry, I'll come around and probably write a tutorial about how to use Cacti... also cactus, probably. So basically, Cacti is a front-end of rrdtool, a tool  - which according to my friend wiki - is an industry-standard data logging tool. Whoa whoa, what is that weird words? Worry not friend, I'll explain it to you. As you can see, industry is industry, it's self explanatory. While standard means a level or stuff that you compare to other stuff so you can say smart things like " it's not up to the standard!" or things like that. 

Now what is data logging? Well as the words says, it is used to log data which input is inserted automatically or manually. However this input is continuous and time based, so it's a chore if inputted manually. This rrdtool then sample the data and then present it to the user in the form of graph, also showing you the min/max/avg of the input. 



And like they said, a picture is worth a thousand words. Now why do we need to use Cacti? Not just rrdtool? Like it was said before, Cacti is the front-end of rrdtool. As far as I know, rrdtool can only produce graph like picture above with no interface with user what so ever (except creating graph with the command line). So we use Cacti to add interface to the rrdtool, what does that mean then? Basically we are using rrdtool to gather the data, transform it into a graph, then present it to us. But, with Cacti you can add some plugin like weathermap - which we will try after this (read : after I done trying it and have the time to write the tutorials) - to show the network map of how the packet we send transferred. And also you can create a multiple graph and simultaneously show the data. And also the neat thing is each data can be presented in different time stamp, like data each minutes, each 5 minutes, each 15 minutes, each days, each months, and so on. 

So to sum it up, Cacti makes using rrdtool more convenient. You don't need to input lots of command line to show a graph of something within different time range. Well, there's also other advantage but let's just focus on installing Cacti (read : too lazy, want to play).

Now then, to install cacti on ubuntu 12.04, just blindly follow this tutorial : 

apt-get install snmpd snmp mysql-server apache2 libapache2-mod-php5 php5-mysql php5-cli php5-snmp

apt-get install libpangol1.0-dev libxml2-dev

apt-get install rrdtool

Download and extract the tarball of cacti. Hm? Where to download it? GOOGLE IT

After that, move it to /var/www. You could move just the files and move it to a new folder called cacti on /var/www or just plain straight move the extracted folder there OR move the extracted folder to new folder called cacti there. After that get inside me... I-I mean get inside the extracted folder (E.F.). Time to create a database in mysql and then import the database in the E.F. to that database.

mysql -u root -p
>create database cacti;
>exit

mysql -u root -p cacti < cacti.sql;

After that, we create an user in mysql so cacti can use it.

mysql -u root -p
>create user [insert username] identified by '[insert password]';
>grant all cacti.* to [username]@localhost identified by '[password]';
>flush privileges;
>exit

Now edit the php.config inside the folder, change the username and password of the database with the one you just registered. Then we create an user with this folder as the home and no login.

useradd [username] -d /var/www/[cacti path] -s /bin/false

Now write this command :

chown -R [username] /var/www/[cacti path]

Finally, add a cron job for every users.

crontab -e

Write this on the bottom line :

*/5 * * * * php /var/www/[cacti path]/poller.php > /dev/null 2>&1

And lastly, open your browser, and go to localhost/cacti. Congrats! If nothing goes wrong, it will show up an install page. Just follow it and then cacti has been installed in your computer!


Easy right? Now have fun monitoring your network, memory usage, temperatures, or anything! 


Oh and about that thought, you guys are lewd. 






reference : wiki-chan, various tutorial on the net (I do insert one or two of my own way, which one? Figure it ;) )





Wednesday, 11 June 2014

FIRST POST!!!

So, this morning a lil' bird told me, "go to blogger.com, make a blog about random things and weird fetishes and weird hobbies... tell the world what a freak you are... oh and maybe write about some useful stuff too...," and here I am, posting the very first post of this blog.

Also, coincidentally, that lil' bird is my assistant coordinator so yeah... And he told me to about a week ago or maybe longer than that...

Nevertheless, I shall do what I have to do, that is write a blog about gami- I mean tutorials and stuffs. And this very first post is reserved as  a warnings to people who were lurking and accidentally found this blog, seriously, you won't stumble upon this blog if you have life, you see the url I made? That's the point.

Now then, onto the first warning :
THIS BLOG IS ABOUT TUTORIALS OF SOME NETWORKING STUFFS!!!
Yes, there is some useful stuff or stuffs here, you just need to tread carefully between the garbage (read : random posts) so, have phun *smiley face*.
Most of the tutorial I write here will be about things I have done, so the tutorials WILL work... you just need to follow it thoroughly *smile cynically*.

Second warning :
THIS BLOG WILL BE FULL ON ENGLISH!!!!

I was going to put that meme image but it's too much of a hassle.. so just imagine you're seeing one right here *wink wink*

Yes, even though I'm Indonesian, I prefer to write on this blog full English. Why? One, it's much more straight forward and two, my blog my rules, suck it up! Oh and also I need to train my writing skills in English, I'm sucks at grammar but can speak fluently, so yeah, you probably get the gist of it. Oh also forgot, the internet is full of people from different country, and English is still the international language... right? What? They want to change it to mandarin? WO AI NI!!!!

Third warning and probably the final warning :
YOU WILL FIND LOTS OF POST ABOUT RANDOM STUFF AND GAMING!!!
Yes, yes, you will find that too... a lot. I'm a gamer and also like to watch movies, be it's cartoon, anime, live action, tv series, as long as I find it interesting, I'll keep doing/watching/playing it. So you'll most likely find more posts about them than tutorial *laugh*. But I'll try to balance it out and make sure it's well archived so you can easily find the tutorials among other posts.... HA!

Oh yeah, since this is a blog, you'll also find post of me ranting about life, whining like a little bitch I am about things, some disturbing pictures, a short story, a long story, some kinda novel chapters (NO COPYING), and other degenerate stuffs... oh and probably my travelling story and things like that.

Okay, those three warnings should sufficient for ya all. Oh if you're wondering who's this weird dude who made this useless blog? Well then kids, let me introduce myself... what? Not interested? Meh, gonna do it anyway though, deal with it!

They call me dickhead (read : Diaz), I studied at Telkom University in Bandung, West Java, Indonesia. Ever heard of it? No? How about Bali? Did that rustled your jimmies? Yes? Excellent!

I studied Telecommunication Engineering and specializing in networking, especially core network (look it up folks!). I still have to learn a lot so pardon me if I mostly post about things that has no connection what so ever with networking, that means I'm gathering info, studying and trying things about networking! Kidding! I probably procrastinate while playing games *laugh*, but seriously, I do study and tries stuffs about networking, so calm your titties. Oh yeah, I also joined in a lab. called Switching Technique Laboratory, where we learn and teach people about switching and networking stuffs!

Previously my position is practicum coordinator, my job is preparing the lab for practicum, where we teach Telkom University student - though only the Telecommunication Engineering division - about switching, well mostly servers like asterisk and the other VoIP servers. But, since I'm a low-life scum and degenerate, I got demoted and transferred as a member of the Operation and Maintenance division. What's my job now? Well friend, can you read? You can? Good!

Well, ever since then, I learned my lesson and aim to become the most hardcore degenerate scum and pervert! Wish me luck guys!

Kidding, kidding, so I guess you understand the main purpose of this blog yes? What? No no, not misleading people, to write guides you won't easily find in the net! That is the main purpose of this blog. So I hope you enjoy your stay here, and come here often! Each time some of you read a post in my blog, I feel happy! You want to make me happy don't you? What? You don't? O-okay... just... enjoy your stay here....