Showing posts with label how-to. Show all posts
Showing posts with label how-to. Show all posts

Monday, December 18, 2006

Hobbit Monitor :: how to report multiple temperture probe results

For Dell PowerEdge servers, OMSA can report temperature for multiple probes, notably, "BMC Ambient", "BMC Planaar", "BMC Riser", and one for each physical processor. I initially wrote my own extension script named 'temps' , which reports all probes under one 'status server1.temps green' call. It works for a test server after I did the following on the Hobbit server:
  • defined a RRD graph section in hobbitgraph.cfg for all probes available on that server
  • NCV_temps='*:GAUGE" in hobbitserver.cfg
  • appended temps=ncv to test2rrd line in hobbitserver.cfg
  • restart hobbitd server
When I deployed the same extension code to a different server, the limitation of such an extension became painfully obvious: the graph definition failed when a different server reports more or less probes. Since hobbitgraph.cfg's graph section is keyed to the test name in hobbitgraph.cfg, I can't add custom graph section per server configuration, not to mention it is not scalable!. As for alerting, I tried setting up thresholds on the server. However, it didn't seem to generate any alert even if the threshold is obviously surpassed. wonder if the 'status blah GREEN' reported by the extension script kinda blocked such centralized checking.

After posting the above questions to Hobbit's mailing list and got no answers, I took upon myself to find the answers. Good thing that Hobbit Monitor is licensed using GPLv1. I found the answers in the source code, rrd/do_temperature.c. [[ All hail goes to Open Source & Henrik! ]]
  • the 'temperature' test is built-in. duh...
  • if  'temperature' is used as 'test name' on the client, nothing needs to be changed on the server end.
  • a lump-all status command will do. Format of the data portion is somewhat restrictive. Each probe needs to be in the format of '&green BMCambient 17 62'. 
  • the test can be done locally on the client and the overall $status is reported by 'status server1.temperature $status'.
Wishes:
  • It'd be nice to have such data report format documented elsewhere other than the source code.
  • The current code (4.2RC1-20060712) didn't take input other than integer too well. It confused the hell out of it, in fact, to the extent it lump the whole long after $status as the probe name. Most of problems I experienced was actually the '.' in my data report confused Hobbit.
  • It'd be nice to be able to specify threshold on the server centrally.

Saturday, October 21, 2006

step-by-step: how to host WordPress under Linux (FC5/RHEL4)

Why:
  • on Blogger: missing certain nice features ( static page support, import/export). Or,
  • on WordPress.com: don't like your own html get stripped off. Your little piggy-bank gets left empty since Google Adsense code get stripped or disabled. Or,
  • want your own professional domain name and such. Or,
  • simply love the experience of DIY and the freedom of customization
Assumptions & Prerequisites:
  • Fedora Core 5 stock installation (All should be applicable to CentOS 4 or RHEL 4 as well, unless the FC5 SELinux changes get in your way.)
    • apache (httpd package) installed.
    • php package installed.
    • mysql-server package installed.
  • The stable release (latest.tar.gz) has been downloaded from wordpress.org and extracted under /var/www/html
  • comfortable with MySQL and SQL commands.
  • starter's knowledge of how a blog works.
Steps to follow:
# set up MySQL access
This is to set up a MySQL database dedicated for WordPress and a user to access this database from the Apache/PHP combo. The schema and data for the database itself will be populated by install.php later. The names used below assume you want user 'wp_master' to have all access to a local database named 'wordpressDB'.
  • /etc/init.d/mysqld start
  • /usr/bin/mysqladmin -u root password 'mysqlAdminpassword'
  • /usr/bin/mysqladmin -u root -p create wordpressDB
  • mysql -Uroot -p mysql
    • insert into user (host, user, password) values ('localhost', 'wp_master', password('mastersecret'));
    • insert into db (host, db, user) values ('localhost', 'wordpressDB', 'wp_master');
      • the 'db' table entry should also grant the 'wp_master' user with most of the privileges to the 'wordpressDB' . So, I simply replaced the 'test' database entry therein, since I am lazy, plus I consider a wild-open test db a security risk.
      • update db set host='localhost',db='wordpressDB',user='wp_master' where host='%' and db='test';
    • commit;
    • restart mysqld by '/etc/init.d/mysqld restart'
# set up MySQL PHP extension support (Otherwise you may get this error, "Your PHP installation appears to be missing the MySQL which is required for WordPress. ")
  • yum -y install php-mysql
  • /etc/init.d/httpd restart
# to set up wp-config.php with your own set of credentials for WP to use to access MySQL
cd /var/www/html/wordpress && cp wp-config-sample.php wp-config.php && vi wp-config.php
# RTFM using your favorite browser

point to your browser to http://localhost/wordpress/readme.html

# initialize/populate your new WP database. Do record the 'admin' account information generated.
point to your browser to follow http://localhost/wordpress/wp-admin/install.php

# Now, time to verify. If it worked, you'd see the default 'hello world' post using the 'default' theme.
point to your browser to http://localhost/wordpress/index.php

# to customize the blog right away, click on 'edit' link inside the blog and log on with the 'admin' account

# about them themes:
Only two themes are bundled (classic/default). To add a theme, find ones you like and download from a trustworthy source.
  • wget http://downloads.wordpress.org/theme/pool.zip
  • cd /var/www/html/wordpress/wp-content/themes && unzip pool.zip
  • Now the new theme(s) would just show up if you go back to edit/presentation/themes
# Get them roamers home
  • import existing blogs and comments from Blogger and other top blog sites.
  • if new, register this new blog with technorati.com, weblogs.com
  • new or updated, brief your readers of the changes [advance notice would be appreciated too]