Archive for the 'Team' Category

Smokeping on FreeBSD 7

Thursday, April 24th, 2008

This write-up assumes a working copy of FreeBSD 7.0.  It was built using 7.0-RELEASE.  It should work on FreeBSD 6.x-STABLE and future versions of FreeBSD 7.  The package versions listed were current as of this writing but may have been updated by the time someone uses this howto.

This is a basic setup of Smokeping.  There are many extra features that I do not touch on here such as multi-target graphs, alerting, slaves, agents and additional probe types.  Check the online documentation for further info.

Please let me know if you run into typos or other technical issues when implementing this.

1.) First let’s update the ports collection.

Setup the update:


# cd /usr/ports/ports-mgmt/portupgrade
# make install clean
# cd /usr/ports/net/cvsup
# make install clean
# cp /usr/share/examples/cvsup/ports-supfile /root/ports-supfile
# pico /root/ports-supfile

Make it look something like this:


#######################################################
*default host=cvsup1.us.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs  tag=.
*default delete use-rel-suffix
#comment the below line if you don't want to update the /src directory
#src-all
#update /usr/ports
ports-all tag=.
#######################################################

Run the update:


# cvsup -L 2 /root/ports-supfile
# portsdb -Uu

Update installed ports:


# portversion -l "<"
# portupgrade -arR
# pkgdb -F

2.) Install the necessary packages.

Descriptions of packages and uses here: http://oss.oetiker.ch/smokeping/doc/smokeping_install.en.html

  •          Perl 5.8:
  • Installed by default with FreeBSD install

  •          RRDTool 1.2.26:

  • # cd /usr/ports/databases/rrdtool
    # make install clean

     

  •          Fping 2.4b2_to-ipv6:

  • # cd /usr/ports/net/fping
    # make install clean

     

  •          EchoPing 6.0.0:

  • # cd /usr/ports/net/echoping
    # make install clean

  •          Dig:
  • Installed by default with FreeBSD install

  •         Perl modules:
  • Socket6

    # cpan
    # install Socket6

    Net:DNS

    # install Net::DNS
    # quit

  •          Apache 2.2.8:

  • # cd /usr/ports/www/apache22
    # make install clean

  •          SpeedyCGI 2.22_4:

  • # cd /usr/ports/www/p5-CGI-SpeedyCGI/
    # make install clean

  •          Smokeping 2.2.7_2:

  • # cd /usr/ports/net-mgmt/smokeping
    # make install clean

    3.) Configure the packages.

  •          Configure Apache:

  • # pico /usr/local/etc/apache22/httpd.conf

    Add:

    (within the <IfModule alias_module> section)


    <Directory "/usr/local/smokeping/htdocs">

    Add:

    (within the <IfModule dir_module> section)

    Add smokeping.cgi after index.html on the DirectoryIndex line to allow smokeping.cgi to load as a default document.

    It should look like:

    DirectoryIndex index.html smokeping.cgi

    Allow the startup of Apache:

    Add the following to /etc/rc.conf

    apache22_enable="YES"           # enable Apache 2.2

    Start Apache:

    # /usr/local/etc/rc.d/apache22 start

  •          Configure Smokeping:
  • Edit the variables in the following files appropriately

    # pico /usr/local/etc/smokeping/config

    Variable example settings in the first section:


    owner    = Systems Administrator
    contact  = sysadmin@domain.com
    mailhost = localhost
    sendmail = /usr/sbin/sendmail
    imgcache = /usr/local/smokeping/htdocs/img
    imgurl   = /smokeping/img
    datadir  = /usr/local/var/smokeping
    piddir  = /usr/local/var/smokeping
    cgiurl   = http://server.domain.com/smokeping/smokeping.cgi
    smokemail = /usr/local/etc/smokeping/smokemail
    tmail = /usr/local/etc/smokeping/tmail

    *** Alerts ***

    The “*** Targets ***” section is where you define your Smokeping targets and build the navigation menu.  It is a little too in depth to cover here.  Play around with it to figure out how it works.

    In depth configuration info is here: http://oss.oetiker.ch/smokeping/doc/smokeping_config.en.html

    There are some configuration samples here: http://oss.oetiker.ch/smokeping/doc/smokeping_examples.en.html

    Verify the path to Speedy:

    # pico /usr/local/smokeping/htdocs/smokeping.cgi

    -first line pointing to full path of speedy

    Customizations to the Smokeping web page templates can be made in the following config files:


    /usr/local/etc/smokeping/smokemail
    /usr/local/etc/smokeping/basepage.html
    /usr/local/etc/smokeping/tmail

    Set file system permissions to make the img folder and files writeable:

    # find /usr/local/smokeping/htdocs/img -type d -exec chmod 777 {} \;
    # find /usr/local/smokeping/htdocs/img -type f -exec chmod 666 {} \;

    Allow the startup of Smokeping:

    Add the following to /etc/rc.conf

  • smokeping_enable=”YES”          # enable smokeping
  • Start Smokeping:


    # /usr/local/etc/rc.d/smokeping start

    Operational Notes:

  •          You should now be able to browse to http://www.yourdomain.com/smokeping/ to view your Smokeping statistics.
  •          You may want to consider securing the Smokeping page with .htaccess users, a firewall or other form of authentication.
  •          I updated the index.html page in the root of the default Apache site:
  •  index.html at /usr/local/www/apache22/data/

    <meta http-equiv=”refresh” content=”0;url=http://www.someotherdomain.com”/>

    This redirects traffic sent to the root of your server to a different domain since this traffic obviously doesn’t need to be hitting the Smokeping server.

  •          When you add new targets or change targets in the /usr/local/etc/smokeping/config file you will need to restart Smokeping:
  • #/usr/local/etc/rc.d/smokeping restart

     

    Installing MySQL4 and MySQL5 on a single FreeBSD 6.2 Server.

    Tuesday, March 11th, 2008

    This write-up makes the following assumptions:

    • Working copy of FreeBSD 6.2.
    • Build: 6.2-RELEASE.

    Which should work on 6.2-STABLE and 7.0 as well.

    Please let me know if you run into typos or other technical issues when implementing this.

    1. Download the latest binaries from mysql.com.
    2. At write-up time this was:

      mysql-5.0.45-freebsd6.0-i386.tar.gz
      mysql-standard-4.1.22-unknown-freebsd6.0-i386.tar.gz
    3. Install MySQL 4.
    4. Uncompress the binary source.

      # cd /usr/local
      # gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
      # ln -s full-path-to-mysql-VERSION-OS mysql4

      Create the daemon user and group.

      # pw groupadd mysql4
      # pw useradd -n mysql4 -c "" -g mysql4 -d /nonexistent -s /usr/sbin/nologin

      Set the file permissions.

      # cd /usr/local/mysql4
      # chown -R root:mysql4 .

      Run the setup database setup script.

      # scripts/mysql_install_db --user=mysql4

      Copy the startup script to the proper location.

      # cp /usr/local/mysql4/support-files/mysql.server /usr/local/etc/rc.d/mysql4.server.sh

      Change two variables in the start script.

      # pico /usr/local/etc/rc.d/mysql4.server.sh

      Change “basedir=” to “basedir=/usr/local/mysql4″
      Change “datadir=/usr/local/mysql/data” to “datadir=/usr/local/mysql4/data”
      Change “pid_file=” to “pid_file=/var/run/mysql4/mysql4.pid”

      Create configuration files.

      Copy one of the sample configuration files based on your server usage replacing xxxx in the line below.

      # cp /usr/local/mysql4/support-files/my-xxxx.cnf /usr/local/mysql4/data/my.cnf

      Change variables in the configuration file.

      # pico /usr/local/mysql4/data/my.cnf

      Add a variable at the top of the [mysqld] section - “user = mysql5″
      Change the “port = 3306″ variables to “port = 3304″
      Change the “socket = /tmp/mysql.sock” variables to “socket = /tmp/mysql4.sock”

      Create a run directory for the MySQL 4 process and set permissions on it.

      # mkdir /var/run/mysql4
      # chown -R mysql4:mysql4 /var/run/mysql4
    5. Install MySQL 5.
    6. Uncompress the binary source.

      # cd /usr/local
      # gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
      # ln -s full-path-to-mysql-VERSION-OS mysql5

      Create the daemon user and group.

      # pw groupadd mysql5
      # pw useradd -n mysql5 -c "" -g mysql5 -d /nonexistent -s /usr/sbin/nologin

      Set the file permissions.

      # cd /usr/local/mysql5
      # chown -R root:mysql5 .

      Run the setup database setup script.

      # scripts/mysql_install_db --user=mysql5

      Copy the startup script to the proper location.

      # cp /usr/local/mysql5/support-files/mysql.server /usr/local/etc/rc.d/mysql5.server.sh

      Change a few variables in the start script.

      # pico /usr/local/etc/rc.d/mysql5.server.sh

      Change “basedir=” to “basedir=/usr/local/mysql5″
      Change “datadir=” to “datadir=/usr/local/mysql5/data”
      Change “pid_file=” to “pid_file=/var/run/mysql5/mysql5.pid”
      Change “server_pid_file=” to “server_pid_file=/var/run/mysql5/mysql5.pid”
      Change “user=mysql” to “user=mysql5″

      Create configuration files.

      Copy one of the sample configuration files based on your server usage replacing xxxx in the line below.

      # cp /usr/local/mysql5/support-files/my-xxxx.cnf /usr/local/mysql5/my.cnf

      Change variables in the configuration file.

      # pico /usr/local/mysql5/my.cnf

      Add a variable at the top of the [mysqld] section - “user = mysql5″
      Change the “port = 3306″ variables to “port = 3305″
      Change the “socket = /tmp/mysql.sock” variables to “socket = /tmp/mysql5.sock”

      Create a run directory for the MySQL 5 process and set permissions on it.

      # mkdir /var/run/mysql5
      # chown -R mysql5:mysql5 /var/run/mysql5
    7. Start the daemons.
    8. # /usr/local/etc/rc.d/mysql4.server.sh start
      # /usr/local/etc/rc.d/mysql5.server.sh start
    9. Post installation configuration.
    10. MySQL4:

      Connect to MySQL

      # /usr/local/mysql4/bin/mysql -u root -P3304 -S/tmp/mysql4.sock

      Remove the anonymous account.

      mysql> DELET FROM mysql.user WHERE Host='localhost' AND User='';

      Set the root password

      mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('difficultpassword1');
      mysql> SET PASSWORD FOR 'root'@'server.domain.com' = PASSWORD('difficultpassword1');

      Create a backupoperator account for backup script access to all databases.

      mysql> GRANT ALL PRIVILEGES ON *.* TO 'backupoperator'@'localhost' IDENTIFIED BY 'difficultpassword2';

      Apply changes.

      mysql> FLUSH PRIVILEGES;

      Quit.

      mysql> QUIT;

      MySQL5:

      Connect to MySQL

      # /usr/local/mysql5/bin/mysql -u root -P3305 -S/tmp/mysql5.sock

      Remove the anonymous account.

      mysql> DROP USER '';

      Set the root password.

      mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('difficultpassword1');
      mysql> SET PASSWORD FOR 'root'@'server.domain.com' = PASSWORD('difficultpassword1');
      mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('difficultpassword1');

      Create a backupoperator account for backup script access to all databases

      mysql> GRANT ALL PRIVILEGES ON *.* TO 'backupoperator'@'localhost' IDENTIFIED BY 'difficultpassword2';

      Quit

      mysql> QUIT;

    That’s it! Create your mysql users and databases and connect your applications.

    Notes:

    1. Command line connections to mysql now require additional connection info to specify port and socket:
      MySQL4 - # /usr/local/mysql4/bin/mysql -u username -ppassword -P3304 -S/tmp/mysql4.sock
      MySQL5 - # /usr/local/mysql5/bin/mysql -u username -ppassword -P3305 -S/tmp/mysql5.sock
    2. Remote connections to mysql will require specifying the correct port in the connection string instead of assuming port 3306.

    Put a Blade to these Servers and they bleed: for a cause.

    Tuesday, February 5th, 2008

    MCSE Boot Camp Studying Tricks & Tips

    Tuesday, January 29th, 2008

    mcse study

    If you just memorize the answers without any lab work, simulations or real world experience, you will never be able to really stand behind your certifications.

    One of the most important things to remember with Microsoft Certification tests is that you have to think about the answer in terms of how Microsoft would want you to answer using only their products and practices. It is not about how it would really be done in practice with the resources and vendors at your disposal.

    We all know that budgets can be tight and the managers won’t always spring for the full solution right out of the gate but with the Microsoft tests you have to set aside the real-world and force yourself to think specific to Microsoft. I find that with the Microsoft tests it is imperative that you study multiple practice exams to get a well rounded feel for the tests. For some of the core exams for the MCSE it is also important that you have many years of real world experience working with Microsoft products, designing networks, designing security and implementing full solutions for clients (especially 070-291). If you just memorize the answers without any lab work, simulations or real world experience you will never be able to really stand behind your certifications.

    With that being said, I do have some great tips on how to help you get through the tests once you have the experience and knowledge:

    I found the Exam Cram series of books very useful for learning the material for each exam. They have a great writing style to keep you focused on getting through the content. Each book also comes with a pretty good practice engine for sample tests. An online company Pass4Sure.com also had great practice tests that I found very useful as well. My favorite site was Exam Collection. All of the tests on this site have been created with Visual CertExam Suite. Visual CertExam Suite is an exam simulator developed for certification exam preparation. It is a very active site with tests and content being added regularly. Like I stated previously it is a great way to help you study for the exams but will in no way provide the value of hands-on lab based studying and years of work experience.

    Test Engine Tips + Memorization Technique

    Once you have read the material, done the labs and have studied hard, I have a tip on how to hold more data in your brain when studying for the tests. It is a technique used for memorization.

    Remember, this is strictly a memorization technique and won’t help you with actually gaining any long term knowledge.

    1. When you are going through the practice exam engine you don’t read the question at all, you just read the answer. Go through the test engine with the answers turned on and just read the correct answer for each one.
    2. Do this 3 times completely. This should take you no more than an hour or two depending on how many questions are in the sample question sets.
    3. Then you start taking practice exams in question subsets of around 46 – 50 questions. Try to select the answers again without reading the questions.
    4. You will repeat this process of taking sample tests until you are consistently scoring 850 or higher. Once you can consistently score 850 or higher (three tests in a row at least) you are ready to take the exam.

    If you follow this method you will be assured to pass. This memorization technique is a great way to cram for tests but do note: if you don’t actually know the content or practice these things in the real world your certifications won’t really mean anything. Make sure to read the material, do the labs, practice in real world jobs and understand the content first. Once that is out of the way then use this technique to just obtain your certifications to back what you already do on a daily basis.

    Good luck.

    Who’s keeping score?

    Sunday, December 9th, 2007

    perfect grade mcse

    I recently attended a Microsoft Certified Systems Engineer Boot Camp, put on by TECHPROS Group, in an attempt to obtain my MCSE. Yet, the certification wasn’t the only goal, I intended to meet all the criteria for the certification - in one week.

    Back in August, I hopped on a plane from Portland, OR to Irvine, CA. To start the trip off, the plane had maintenance issues, so as we started to take off - literally as the front of the plane left the ground - the pilot immediately landed the plane. The plane barely stopped in time before its tires rolled off the end of the runway. For the next two hours we were stalled, waiting for the mechanical issues to be resolved.

    opus interactive creative

    MCSE credentials are the certifications for professionals who analyze the business requirements and design and implement the infrastructure for business solutions based on the Microsoft Windows Server System.

    Because of this travel hurdle, I arrived three hours late to the boot camp. Missing certification orientation and dinner might phase one’s moral, but here at opus:interactive, it takes more than a false start at the beginning of the race to thwart a victory - a lot more.

    The boot camp was held at a rented house in the hills outside Irvine, CA. It was a very nice house with plenty of space and rooms for all fifteen of the boot camp attendees (below). TECHPROS had great content setup for us in terms of lectures and labs (below). The first three days we worked through labs with VMware as well as lectures. I finished the first lab Sunday night before turning in around 1AM. The second day I finished the second lab by dinner time and was ready to start studying for the tests. I crammed for 14 hours straight and attempted my first test on Tuesday:

    • Exam 70-298: Designing Security for a Windows Server 2003 Network

    I passed with a perfect score 1000/1000! The rest of the day was spent going through more labs and some simulations TECHPRO had setup to prepare us for the simulations on 70-291. I studied until around 2AM and was ready to take more tests on Wednesday.

    I was the only student to attempt three tests in one day and the ones I chose were:

    • Exam 70-291: Implementing, Managing, and Maintaining a Windows Server 2003 Network Infrastructure (rumor has it, this is the most challenging of the MCSE core exams)
    • Exam 70-285: Designing a Microsoft Exchange Server 2003 Organization
    • Exam 70-270: Installing, Configuring, and Administering Microsoft Windows XP Professional

    I ended up passing all three that day with a 984/1000 on the XP test! Even with these three tests behind me, I didn’t stop. I continued cramming and working on other labs and lectures for the rest of the day into the wee hours of Thursday, turning in around 3AM.

    I wanted to continue the testing insanity and scheduled three more tests for Thursday as follows:

    • Exam 70-293: Planning and Maintaining a Windows Server 2003 Network Infrastructure
    • Exam 70-294: Planning, Implementing, and Maintaining a Windows Server 2003 Active Directory Infrastructure
    • Exam 70-284: Implementing and Managing Microsoft Exchange Server 2003

    I was again the only student to attempt three tests that passed them all in one day.

    opus interactive testing hardware

    An example of one of the testing lab setups provided by TECHPRO Group, where I completed the testing for my MCSE (+)

    The camp was winding down and there was only one more testing opportunity before the flight back to Portland on Friday afternoon. I schedule one final test on Friday morning which would achieve my MCSE +Messaging.

    I ended up taking a second test because I had two hours to kill before catching a ride to the airport. I took the following tests:

    • Exam 70-290: Managing and Maintaining a Windows Server 2003 Environment
    • Exam 70-350: Implementing Microsoft Internet Security and Acceleration (ISA) Server 2004

    Both of these test I completed and passed, which brought my total of successfully passed tests to nine in four days! (Phew, what a relief!) I was literally brain dead at this point.

    One week later I felt the itch again and decided I should take the last elective for the Security add-on to the MCSE. I quickly scheduled this test:

    • Exam 70-299: Implementing and Administering Security in a Microsoft Windows Server 2003 Network

    Another perfect score of 1000/1000! Completing that exam gave me my MCSE +Security.

    Why stop there! I thought and continued a study for the new Hosting Specialization Exam:

    • Exam 70-501: TS: Microsoft Windows Server 2003 Hosted Environments, Configuring, and Managing

    This test encapsulates what we offer here at opus:interactive and as such: I nailed it with a 987/1000 score! That achieved me the MCTS: Hosting Specialization certification as well.

    In recent months we’ve been internally studying the ITIL Foundations and was finally ready to take that exam. This particular exam was administered by EXIN the Examination Institute for Information Science and is the first step in us implementing ITIL for our organization. I studied all the material I could find and ran some practice exam engines. I was finally ready to take the test. I aced that test with a perfect score of 1000/1000! Obtaining my ITIL Foundations Certification.

    A lot of testing and a lot of proof of just how excellent our organization and team are. Some might even say: the best in the business.

    TECHPRO Bunks

    Little time was spent in these for I was busy studying!