<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>a little bit of zeank &#187; hacking</title>
	<atom:link href="http://blog.jwchat.org/category/hacking/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jwchat.org</link>
	<description>coding and stuff</description>
	<lastBuildDate>Wed, 30 Mar 2011 07:07:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Nagios Plugin to monitor BOSH services</title>
		<link>http://blog.jwchat.org/2009/06/17/nagios-plugin-to-monitor-bosh-services/</link>
		<comments>http://blog.jwchat.org/2009/06/17/nagios-plugin-to-monitor-bosh-services/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 15:29:18 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Jabber]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[scriplets]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://blog.jwchat.org/?p=123</guid>
		<description><![CDATA[Enjoy! #!/usr/bin/perl -w # # check_bosh plugin for nagios # # usage: # check_bosh -U url -H host # # Check if bosh service running at specified address # # initial version: 3 May 2000 by Truongchinh Nguyen and Karl DeBisschop # # current status: $Revision: 1196 $ # # Copyright Notice: GPL # $Id: [...]]]></description>
			<content:encoded><![CDATA[<p>Enjoy!</p>
<p><code><br />
#!/usr/bin/perl -w<br />
#<br />
# check_bosh plugin for nagios<br />
#<br />
# usage:<br />
#    check_bosh -U url -H host<br />
#<br />
# Check if bosh service running at specified address<br />
#<br />
# initial version: 3 May 2000 by Truongchinh Nguyen and Karl DeBisschop<br />
#<br />
# current status: $Revision: 1196 $<br />
#<br />
# Copyright Notice: GPL<br />
# $Id: check_bosh.pl 1196 2009-06-17 15:20:46Z s.strigler $<br />
#</p>
<p>use strict;<br />
use lib "/usr/lib/nagios/plugins";<br />
use utils qw($TIMEOUT %ERRORS &#038;print_revision &#038;support);<br />
use vars qw($PROGNAME);<br />
my ($verbose,$host,$response,$state);<br />
my ($opt_V,$opt_H,$opt_h,$opt_U);<br />
$opt_V = $opt_h, $opt_h = $opt_U = '';<br />
$state = 'UNKNOWN';</p>
<p>$PROGNAME = "check_bosh";<br />
sub print_help ();<br />
sub print_usage ();</p>
<p>$ENV{'BASH_ENV'}='';<br />
$ENV{'ENV'}='';<br />
$ENV{'PATH'}='';<br />
$ENV{'LC_ALL'}='C';</p>
<p>use Getopt::Long;<br />
Getopt::Long::Configure('bundling');<br />
GetOptions(<br />
	"V"   => \$opt_V,   "version"    => \$opt_V,<br />
	"h"   => \$opt_h,   "help"       => \$opt_h,<br />
 	"U=s" => \$opt_U,   "url=s"      => \$opt_U,<br />
    "H=s" => \$opt_H,   "host=s"     => \$opt_H,<br />
 	"v+"  => \$verbose, "verbose+"   => \$verbose<br />
);</p>
<p># -h means display verbose help screen<br />
if ($opt_h) { print_help(); exit $ERRORS{'OK'}; }</p>
<p># -V means display version number<br />
if ($opt_V) {<br />
	print_revision($PROGNAME,'$Revision: 1196 $ ');<br />
	exit $ERRORS{'OK'};<br />
}</p>
<p># -U means URL<br />
unless ($opt_U) { print_usage(); exit $ERRORS{'UNKNOWN'}; }</p>
<p># -H means host name<br />
unless ($opt_H) { print_usage(); exit $ERRORS{'UNKNOWN'}; }</p>
<p>if (! utils::is_hostname($opt_H)){<br />
	print "$opt_H is not a valid host name\n";<br />
	print_usage();<br />
	exit $ERRORS{"UNKNOWN"};<br />
}</p>
<p># Just in case of problems, let's not hang Nagios<br />
$SIG{'ALRM'} = sub {<br />
        print ("ERROR: No response from RPC server (alarm)\n");<br />
        exit $ERRORS{"UNKNOWN"};<br />
};<br />
alarm($TIMEOUT);</p>
<p>$state = &#038;check_bosh($opt_U, $opt_H);</p>
<p>if ($state eq 'OK') {<br />
	print "$state: BOSH service at $opt_U up and running\n";<br />
}elsif ($state eq 'WARNING') {<br />
    print "$state: BOSH service not working correctly. Bad hostname given?\n";<br />
}else{<br />
    print "$state: BOSH service at $opt_U is not running\n";<br />
}<br />
exit $ERRORS{$state};</p>
<p>sub check_bosh() {<br />
    my $url = shift;<br />
    my $host = shift;</p>
<p>    use LWP::UserAgent;<br />
    my $ua = LWP::UserAgent->new;</p>
<p>    my $req = HTTP::Request->new(POST => $url);<br />
    $req->content_type('text/xml; charset=utf-8');<br />
    my $payload =  "<body content='text/xml; charset=utf-8' hold='1' xmlns='http://jabber.org/protocol/httpbind' to='$host' wait='300' rid='205152' ver='1.6' xmlns:xmpp='urn:xmpp:xbosh' xmpp:version='1.0'/>";<br />
    print "SEND: ", $payload, "\n" if($verbose);</p>
<p>    $req->content($payload);</p>
<p>    my $res = $ua->request($req);</p>
<p>    if ($res->is_success) {<br />
        print "RECV: ", $res->content, "\n" if ($verbose);</p>
<p>        if ($res->content =~ /type='terminate'/) {<br />
            return 'WARNING';<br />
        } elsif ($res->content =~ /sid='([^']+)'/) {<br />
            $req = HTTP::Request->new(POST => $url);<br />
            $req->content_type('text/xml; charset=utf-8');</p>
<p>            $payload = "<body content='text/xml; charset=utf-8' xmlns='http://jabber.org/protocol/httpbind' sid='$1' rid='205153' type='terminate'/>";<br />
            print "SEND: ", $payload, "\n" if($verbose);<br />
            $req->content($payload);</p>
<p>            $res = $ua->request($req);</p>
<p>            if ($res->is_success) {<br />
                print "RECV: ", $res->content, "\n" if ($verbose);<br />
            }<br />
            else {<br />
                print $res->status_line, "\n" if ($verbose);<br />
                return 'CRITICAL';<br />
            }<br />
        }<br />
    }<br />
    else {<br />
        print $res->status_line, "\n" if ($verbose);<br />
        return 'CRITICAL';<br />
    }</p>
<p>    return 'OK';<br />
}</p>
<p>sub print_help() {<br />
	print_revision($PROGNAME,'$Revision: 1196 $ ');<br />
	print "Copyright (c) 2009 Stefan Strigler\n";<br />
    print "adopted from check_rpc by Karl DeBisschop/Truongchinh Nguyen/Subhendu Ghosh\n";<br />
	print "\n";<br />
	print "Check if bosh service is up and running\n";<br />
	print "\n";<br />
	print_usage();<br />
	print "\n";<br />
	print "  <url>           URL of bosh service\n";<br />
    print "  <host>          XMPP host name\n";<br />
	print "  [-v]            Verbose \n";<br />
	print "  [-v -v]         Verbose - will print supported programs and numbers \n";<br />
	print "\n";<br />
	support();<br />
}</p>
<p>sub print_usage () {<br />
	print "Usage: \n";<br />
	print " $PROGNAME -U url -H host [-v]\n";<br />
	print " $PROGNAME [-h | --help]\n";<br />
	print " $PROGNAME [-V | --version]\n";<br />
}<br />
</host></url></code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2009/06/17/nagios-plugin-to-monitor-bosh-services/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>today: radio talk on openmicroblogging (in german)</title>
		<link>http://blog.jwchat.org/2008/10/08/today-radio-talk-on-openmicroblogging-in-german/</link>
		<comments>http://blog.jwchat.org/2008/10/08/today-radio-talk-on-openmicroblogging-in-german/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 07:20:50 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Jabber]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[microblogging]]></category>
		<category><![CDATA[open-birdcage]]></category>

		<guid isPermaLink="false">http://blog.jwchat.org/2008/10/08/today-radio-talk-on-openmicroblogging-in-german/</guid>
		<description><![CDATA[Today I&#8217;ll be giving an interview to radio fsk, hamburg. The topic is about twitter and openmicroblogging. They&#8217;ll have Cem Basman from WhisperN News and Media (brokerz) at face and I&#8217;ll join later on to talk about the role of XMPP in the field of openmicroblogging. The live broadcast calls itself Nerdalert and will start [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ll be giving an interview to <a href="http://www.fsk-hh.org/">radio fsk, hamburg</a>. The topic is about twitter and openmicroblogging. They&#8217;ll have <a href="http://sprechblase.wordpress.com/">Cem Basman</a> from WhisperN News and Media (<a href="http://brokerz.com">brokerz</a>) at face and I&#8217;ll join later on to talk about the role of XMPP in the field of openmicroblogging. The live broadcast calls itself <a href="http://nerdalert.de/cgi-bin/main.pl?NerdAlert">Nerdalert</a> and will start at 17:00h CEST. And of course there is also a <a href="http://www.fsk-hh.org/livestream">livestream</a> available.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2008/10/08/today-radio-talk-on-openmicroblogging-in-german/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Tech Talk on Building JavaScript Libraries</title>
		<link>http://blog.jwchat.org/2007/08/27/google-tech-talk-on-building-javascript-libraries/</link>
		<comments>http://blog.jwchat.org/2007/08/27/google-tech-talk-on-building-javascript-libraries/#comments</comments>
		<pubDate>Mon, 27 Aug 2007 07:30:09 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[JSJaC]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://zeank.in-berlin.de/2007/08/27/google-tech-talk-on-building-javascript-libraries/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-474821803269194441&#038;hl=de" flashvars=""> </embed></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jwchat.org/2007/08/27/google-tech-talk-on-building-javascript-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

