It’s been a while since I wrote anything down, albeit I’ve been keeping very busy. This week though, I’ve been digging through lots of articles and such and it triggered a thought in my mind…If I document what I do publically, I can always go back and look at it (I refer to my booting an OS from a USB article all too often) and also I can share my experiences with the broader world!
Today’s post as the title alludes to takes us down the MRTG route in the Azure world. First off, MRTG is a great program that was written many years back by a guy named Tobi Oetiker. The latest release is 2.17.4 which was released in January 2012, yet it’s still a great tool. The simple idea behind it – you run a script every 5 minutes that takes two input variables and then it graphs them. The most common use for this is routers – in and out packets – hence the name MRTG (Multi-Router Traffic Grapher). However, you can do just about anything you want with MRTG. One of the things I do with it is simply plot the same number twice in some instances which gives a great effect to the number I’m displaying (say the number of active helpdesk calls).
At any rate, with the ability to go Hybrid Cloud, the premise of this article is to explain how to get it working in Azure on Windows 2012R2 (sure you can do the same on-prem too)…If you’ve got an MSDN account, you’ve got monthly credit to use too, that’s what I do with mine So, let’s get going:
1. Create a new VM in azure (New -> Compute -> Virtual Machine -> Quick Create)
Windows Server 2012R2 Datacenter – Basic A0 is what I went for
2. After the VM Builds, log in and patch it
3. Turn off IE Enhanced Security (for the time being) – Server Manger -> Local Server -> IE Enhanced Security
5. Run the ActiveState installer and install to c:\perl64 (the default directory)
7. Unzip the package to c:\
8. Rename mrtg-2.17.4 it to mrtg
10. Run the Web Platform Installer and choose to install PHP 5.6.0 (Note this will install 19 “components”)
11. Download the x86 version of the Visual C++ Redistributable 2012 (even if you have an x64 install use the x86 version of the C++ package because PHP will run x86) Install PHP 5.6.0 (optional)
12. Install the Visual C++ Redist
14. Copy the following .dll files in to to c:\program files(x86)\php\v5.6\ cairo, expat, fontconfig, gobject-2, pango-1, pangocairo-1, pangoft2-1, pangowin32-1, pixman-1, rrdlib
15. Copy php_rrd.dll in to c:\program files(x86)\php\v5.6\ext\
16. Open c:\program files(x86)\php\v5.6\php.ini and add the following to the very bottom of the file “extension=php_rrd.dll”
17. Open notepad and create a file that has “<?php phpinfo();?>” in it (sans the “‘s)
18. Save this file to c:\inetpub\wwwroot as “about.php” (make sure you put “‘s around the file name so notepad saves the .php extension)
19. Open IE and navigate to http://localhost/about.php to see it’s installed correctly
20. Scroll further down to also see that the RRD library is enabled
21. Open a command prompt
22. Change the directory to c:\mrtg\bin
23. run “perl mrtg”
If MRTG is installed correctly, you’ll see the program disclaimer.
The next article will talk about what you can do with MRTG and PHP together. Hope you enjoyed!