Archive

Archive for the ‘HA & HPC’ Category

vcs service group and resource attributes dictionary page

May 22nd, 2012 No comments

Here’s all the veritas vcs service group and resource attributes and their explanation/crab sheet/cheatsheet(actually this is the file content of /etc/VRTSvcs/conf/attributes/cluster_attrs.xml):

Read more…

Categories: HA, HA & HPC Tags:

awstats installation and configuration guide on linux centos

May 21st, 2012 No comments

Here’s a howto/guide about awstats installation and configuration on linux:

yum -y install awstats

here’s main things installed:

/var/www/awstats
/etc/awstats
/etc/cron.hourly/00awstats
/etc/httpd/conf.d/awstats.conf
/usr/bin/awstats_buildstaticpages.pl
/usr/bin/awstats_exportlib.pl
/usr/bin/awstats_updateall.pl
/usr/bin/logresolvemerge.pl
/usr/bin/maillogconvert.pl
/usr/bin/urlaliasbuilder.pl

mv /etc/awstats/awstats.localhost.localdomain.conf /etc/awstats/awstats.mysite.conf
vi /etc/awstats/awstats.mysite.conf

LogFile=”/usr/bin/logresolvemerge.pl /var/log/httpd/*-access.log|”

#there’s a way to add gzipped log file for analyzing
#LogFile=”gzip -d </var/log/apache/access.log.gz|”
LogType=W #W is for analyzing web log files
LogFormat=1 #or use a custom log format if you don’t use the combined log format
SiteDomain=”www.yoursite.com”
AllowToUpdateStatsFromBrowser=1

cd /var/www/awstats/

chmod -R 755 /var/log/httpd #If you do not add x permission to these log files, you’ll encounter error message below when you click “Update now” in browser:

awstats Couldn’t open server log file xxxx: Permission denied

perl ./awstats.pl -config=mysite -update #or update from browser. or through logrotate(http://awstats.sourceforge.net/docs/awstats_faq.html#ROTATE) or through crontab(http://awstats.sourceforge.net/docs/awstats_faq.html#CRONTAB)
perl ./awstats.pl -config=mysite -output -staticlinks > awstats.mysite.html
Now visit http://www.yoursite.com/awstats-html/awstats.mysite.html#or through http://www.yoursite.com/awstats/awstats.pl?config=mysite(like http://www.yoursite.com/awstats/awstats.pl?month=MM&year=YYYY&output=unknownos). Reports are generated in real time from the statistics data base. If this is slow, or putting too much load on your server, consider generating static reports instead.
Here’s the httpd configuration file for awstats:

[root@doxer awstats]# cat /etc/httpd/conf.d/awstats.conf
Alias /awstats/icon/ /var/www/awstats/icon/
Alias /awstats-html/ /var/www/awstats/
ScriptAlias /awstats/ /var/www/awstats/
<Directory /var/www/awstats/>
AllowOverride All
DirectoryIndex awstats.pl
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
#Alias /css/ /var/www/awstats/css/
#Alias /js/ /var/www/awstats/js/

NB:

1.If you encounter 500 internal server error, this article may be useful for you to troubleshoot http://www.doxer.org/learn-linux/resolved-awstats-500-internal-server-error-after-installation-on-centos-linux/

2.For more info, you can refer to official site here http://awstats.sourceforge.net/docs/index.html

resolved awstats 500 internal server error after installation on centos linux

May 21st, 2012 No comments

After installation of awstats on centos according to official installation guide, the dynamically view from browser was rendering ok, i.e. http://www.mysite.com/awstats/awstats.pl?config=mysite was ok and I can see statistics with no problem. However, when I tried view the static html page generated by perl ./awstats.pl -config=mysite -output -staticlinks > awstats.mysite.html, there was 500 internal server error when visiting this page: http://www.mysite.com/awstats/awstats.mysite.html.

This is quite weird because usually the ones that complain about 500 internal server error are usually dynamically generated pages such as php pages or perl cgi script pages. But this problem was that only static html page gave 500 internal server error, and the dynamically generated pages were ok to render. I tried moving the html file to some other virtualhost and it’s ok to render without the horrible 500 internal server error: statistics looked good and all icons were ok.

The configuration of awstats in httpd conf file was like this:

[root@doxer awstats]# cat /etc/httpd/conf.d/awstats.conf
Alias /awstats/icon/ /var/www/awstats/icon/
ScriptAlias /awstats/ /var/www/awstats/
<Directory /var/www/awstats/>
AllowOverride All
DirectoryIndex awstats.pl
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
#Alias /css/ /var/www/awstats/css/
#Alias /js/ /var/www/awstats/js/

Pay attention to line with red color. It took me a whole forenoon before I found the root cause(there was no useful error log for this awstats 500 internal server error). As detailed in httpd documents:

The ScriptAlias directive has the same behavior as the Alias directive, except that in addition it marks the target directory as containing CGI scripts that will be processed by mod_cgi’s cgi-script handler.

This is quite clear that files under directory followed by ScriptAlias directive will be treated as CGI scripts. As the static html file was placed under the directory which should only contains CGI scripts, so 500 internal server error threw when visiting that static html file under it.

To fix this awstats 500 internal server error, change the configuration file as the following:

[root@doxer awstats]# cat /etc/httpd/conf.d/awstats.conf
Alias /awstats/icon/ /var/www/awstats/icon/
Alias /awstats-html/ /var/www/awstats/
ScriptAlias /awstats/ /var/www/awstats/
<Directory /var/www/awstats/>
AllowOverride All
DirectoryIndex awstats.pl
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
#Alias /css/ /var/www/awstats/css/
#Alias /js/ /var/www/awstats/js/

After this, you should now be able to see the awstats static html file with no problem.(use http://www.mysite.com/awstats-html/awstats.mysite.html instead of http://www.mysite.com/awstats/awstats.mysite.html)

NB:

Here’s an article about awstats installation on linux howto:  http://www.doxer.org/learn-linux/awstats-installation-steps-on-linux-centos/

what is fence or fencing device

May 16th, 2012 No comments

To understand what is fencing device, you need first know something about split-brian condition. read here for info: http://linux-ha.org/wiki/Split_Brain

Here’s is something about what fence device is:

Fencing is the disconnection of a node from shared storage. Fencing cuts off I/O from shared storage, thus ensuring data integrity. A fence device is a hardware device that can be used to cut a node off from shared storage. This can be accomplished in a variety of ways: powering off the node via a remote power switch, disabling a Fibre Channel switch port, or revoking a host’s SCSI 3 reservations. A fence agent is a software program that connects to a fence device in order to ask the fence device to cut off access to a node’s shared storage (via powering off the node or removing access to the shared storage by other means).

To check whether a LUN has SCSI-3 Persistent Reservation, run the following:

root@doxer# symdev -sid 369 show 2040|grep SCSI
SCSI-3 Persistent Reserve: Enabled

And here’s an article about I/O fencing using SCSI-3 Persistent Reservations in the configuration of SF Oracle RAC: http://sfdoccentral.symantec.com/sf/5.0/solaris64/html/sf_rac_install/sfrac_intro13.html

Categories: HA & HPC, Hardware, NAS, SAN, Storage Tags:

differences between freezing vcs system and freezing service group

May 16th, 2012 No comments

In veritas vcs, freezing a system prevents service groups from coming online on the system if they failover from another node in the cluster. But this does not prevent faults from failing any service group already online on the system.

To prevent veritas intervention on faults caused by expected changes (even if the symptoms are unexpected) we would usually freeze the service group. This prevents any online/clean or restart operation kicking in on detection of faults.

After your modification on vcs, you need check that resources are not autodisabled and make sure that the config is made ro again.

Here’s the step to freeze service group(s) in vcs:
/opt/VRTS/bin/haconf -makerw
mkdir /var/tmp/veritas_config_backup_`date +%F`
cp -R /etc/VRTSvcs /var/tmp/veritas_config_backup_`date +%F`
/opt/VRTS/bin/hagrp -freeze $i -persistent
/opt/VRTS/bin/haconf -dump -makero

Categories: HA, HA & HPC Tags: ,

tips about nagios notes_url action_url

March 16th, 2012 No comments

nagios has two useful parameters, i.e. notes_url & action_url.

Firstly, you can modify notes_url in template configuration file:
# Generic service definition template – This is NOT a real service, just a template!
define service{
name generic-service ; The ‘name’ of this service template
notes_url http://www.yoursite.com/mediawiki/index.php/nagios#$SERVICEDESC$
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service ‘freshness’
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
is_volatile 0 ; The service is not volatile
check_period 24×7 ; The service can be checked at any time of the day
max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state
normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
retry_check_interval 2 ; Re-check the service every two minutes until a hard state can be determined
contact_groups admins ; Notifications get sent out to everyone in the ‘admins’ group
notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
notification_interval 60 ; Re-notify about service problems every hour
notification_period 24×7 ; Notifications can be sent out at any time
register 0 ; DONT REGISTER THIS DEFINITION – ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}

Then, when you define a new service check and want to use that notes_url in combination with notes_url, then when define the service check:
define service{
use generic-service ;using this template will auto enable notes_url, and it will replace $SERVICEDESC$ macro in template with service_description below
host_name yoursite.com
servicegroups HttpCheck
service_description aboutus #this will be used to replace $SERVICEDESC$ macro in template definition
check_command check_http!-u “/aboutus/” -t 60 -w 15 -c 30 -f follow -l -r 010
action_url http://$HOSTADDRESS$/aboutus/ #there’ll be a “cloud icon” in nagios web gui when you add this line
}

Now here’s the result after adding nagios action_url and notes_url:

You can try click on each icons and see the fancy thing!

Here’s the snapshot:

nagios notes_url action_url(click to see the full size image)