FireStats error : Database error: INSERT command denied to user 'dbo244183939'@'74.208.16.197' for table 'wp_firestats_pending_data'

MySQL Version: 5.0.81-log
SQL Query:
INSERT DELAYED INTO `wp_firestats_pending_data` ( `timestamp`, `site_id` , `url` , `referrer` , `useragent` , `ip`, `type` ) VALUES ( NOW(), '1', 'http://www.pinoytux.com/tips/tip-perl-script-to-check-site-availability', '', 'CCBot/1.0 (+http://www.commoncrawl.org/bot.html)', '38.107.191.87', NULL )
May
23

Tip: Perl script to Check Site Availability

System Administrators’s ‘common tasks’ are usually monitoring numbers of servers and network connections, and doing each monitoring is rather tedious. So to make our jobs and lives easier, we write scripts to automate repetitive tasks.

Since this is my Linux blog anyway, I decided to share one of scripts that I use in the office. This one is the Perl script that I use to check a specific site if the keyword is present, hence confirming that the site is up and accessible.

In this example I am using dattebayo.com’s parsing URL to test the script.

Dattebayo is one of the subtitling groups that provide fansubs of famous Japanese animes like Naruto and Bleach.

This script requires that you have the following packages installed:
- perl
- mutt
- sendmail or equivalent MTU

Please refrain from parsing the URL too many times or DB will ban your IP. Read their terms of usage here.

#!/usr/bin/perl -w

$get_url=”GET http://dattebayo.com/t/dump”;
$sidebar_list=`$get_url`;
$keyword=”Bleach”;
$date=`date +%c`;

#print $sidebar_list;

if ( $sidebar_list =~ /$keyword/ ) {
# print “Site is UP”;
# print $sidebar_list;
}
else {
`echo “Cannot Open Site. Check Server. \nTime Stamp: $date ” > text_mesg.txt`;
`cat text_mesg.txt|mutt -s “DB Site Error” “kamotegirl\@pinoytux.com”`;
}

Then put this in your crontab set to run every 2 hours so as not to flood the webserver with spurious requests (see above warning).

# crontab -e

Enter this line:

* */2 * * * /home/bom/shippuuden.pl (Change this to where you saved your script)

Save and exit.

Your shippuuden script is now set to run and send email to your address if the site is inaccessible.

Do you find this script useful or trash?

Related Posts

2 Comments to “Tip: Perl script to Check Site Availability”

  • geetha Windows XP Mozilla Firefox 3.0.10 May 20, 2009 at 9:09 pm

    Its very simple to check the availability of the website with 100pulse.com
    No need to install any software.
    A Free and reliable service online.

  • Установка CMS Windows XP Internet Explorer 6.0 July 31, 2009 at 9:16 pm

    Выполняю установку и настройку различных CMS систем.
    Предоплата 50% стоимость работы от 400р.
    Оплата Web Main или Яndex деньги.
    Информация для связи ISQ 429606266 Александр.

Post comment

CommentLuv Enabled