text:
System Monitoring with Xymon/Developer Guide

Reference Books

 * C Programming
 * UNIX Advance programming
 * UNIX Network Programming

SVN for Xymon Tutorials
Followings are some examples using svn to interact with hobbit on sourceforge.net. [tjyang@ibm hobbitmon]$ svn ls https://hobbitmon.svn.sourceforge.net/svnroot/hobbitmon branches/ sandbox/ tags/ trunk/ [tjyang@ibm hobbitmon]$
 * list out the sub directory of xymon SVN directory.

[tjyang@ibm hobbitmon]$ svn log -v -r HEAD:\{`date +%Y-%m-%d -d'7 days ago'`\} \ https://hobbitmon.svn.sourceforge.net/svnroot/hobbitmon
 * find out changes in last 7 days.

r6033 | storner | 2009-01-08 07:43:23 -0600 (Thu, 08 Jan 2009) | 1 line Changed paths: M /trunk/client/Makefile

Make sure client scripts are executable

r6032 | storner | 2009-01-07 06:00:45 -0600 (Wed, 07 Jan 2009) | 1 line Changed paths: M /branches/4.2.3/build/md5.dat A /branches/4.2.3/hobbitd/webfiles/hostlist_footer A /branches/4.2.3/hobbitd/webfiles/hostlist_form A /branches/4.2.3/hobbitd/webfiles/hostlist_header M /branches/4.2.3/lib/headfoot.c  M /branches/4.2.3/lib/headfoot.h   M /branches/4.2.3/web/Makefile A /branches/4.2.3/web/hobbit-hostlist.c  A /branches/4.2.3/web/hobbit-hostlist.sh.DIST

Added hostlist CGI from trunk

r6031 | storner | 2009-01-07 05:59:22 -0600 (Wed, 07 Jan 2009) | 2 lines Changed paths: M /branches/4.2.3/build/generate-md5.sh

Adapted to work with Subversion and new source directories.

r6030 | storner | 2008-12-17 05:39:49 -0600 (Wed, 17 Dec 2008) | 2 lines Changed paths: A /branches/4.2.3 (from /branches/4.2.2:6029)

New branch off the 4.2.2 release for maintenance - will become 4.2.3 (if needed).

[tjyang@ibm hobbitmon]$

 * Checking out hobbit source tree using svn.

[tjyang@fc6 ]$ svn co https://hobbitmon.svn.sourceforge.net/svnroot/hobbitmon hobbitmon A   hobbitmon/tags/rel_4_0-20041201/web/bb-findhost.cgi.1 A   hobbitmon/tags/rel_4_0-20041201/web/bb-ack.c A    hobbitmon/tags/rel_4_0-20041201/web/hobbitsvc-trends.c A    hobbitmon/tags/rel_4_0-20041201/web/bb-snapshot.c A    hobbitmon/tags/rel_4_0-20041201/web/hobbitsvc.c A    hobbitmon/tags/rel_4_0-20041201/web/bb-eventlog.cgi.1 A   hobbitmon/tags/rel_4_0-20041201/web/bb-rep.cgi.1 A   hobbitmon/tags/rel_4_0-20041201/web/bb-replog.cgi.1 A   hobbitmon/tags/rel_4_0-20041201/web/bb-hist.c A    hobbitmon/tags/rel_4_0-20041201/web/bb-csvinfo.c A    hobbitmon/tags/rel_4_0-20041201/web/bb-webpage.c Checked out revision 5644.

[tjyang@fc6 hobbitmon]$ ls -la total 28 drwxrwxr-x 6 tjyang tjyang 4096 Aug  4 09:11. drwxr-xr-x 38 tjyang tjyang 4096 Aug 4 09:09 .. drwxrwxr-x 3 tjyang tjyang 4096 Aug  4 09:11 branches drwxrwxr-x 6 tjyang tjyang 4096 Aug  4 10:04 .svn drwxrwxr-x 67 tjyang tjyang 4096 Aug 4 10:04 tags drwxrwxr-x 16 tjyang tjyang 4096 Aug 4 09:11 trunk [tjyang@fc6 hobbitmon]$

to revert all the changes you made to hobbit src tree. svn revert --recursive. [tjyang@fc6 hobbitmon]$ svn mkdir branches/tjyang A        branches/tjyang [tjyang@fc6 hobbitmon]$ svn copy trunk branches/tjyang A        branches/tjyang/trunk [tjyang@fc6 hobbitmon]$ svn commit -m "T.J. Yang's copy of hobbit" Authentication realm:  SourceForge Subversion area Password for 'tjyang': Adding        branches/tjyang Adding        branches/tjyang/trunk
 * As one of hobbit developers, you can create a branch.
 * Following example create a instance of hobbit by tjyang.

Committed revision 5645. [tjyang@fc6 hobbitmon]$

[tjyang@fc6 trunk]$ svn status A     pkg M     README [tjyang@fc6 trunk]$ mkdir pkg/tww [tjyang@fc6 trunk]$ svn status ?     pkg/tww A     pkg M     README [tjyang@fc6 trunk]$ svn add pkg/tww A        pkg/tww [tjyang@fc6 trunk]$ pwd /home/tjyang/hobbitmon/branches/tjyang/trunk [tjyang@fc6 trunk]$ ls bbdisplay bbproxy  Changes  common     configure.client  COPYING  debian  hobbitd  lib  README         RELEASENOTES  web bbnet     build    client   configure  configure.server  CREDITS  docs    include  pkg  README.CLIENT  rpm [tjyang@fc6 trunk]$ pwd /home/tjyang/hobbitmon/branches/tjyang/trunk [tjyang@fc6 trunk]$ ls bbdisplay bbproxy  Changes  common     configure.client  COPYING  debian  hobbitd  lib  README         RELEASENOTES  web bbnet     build    client   configure  configure.server  CREDITS  docs    include  pkg  README.CLIENT  rpm [tjyang@fc6 trunk]$ ls bbdisplay bbproxy  Changes  common     configure.client  COPYING  debian  hobbitd  lib  README         RELEASENOTES  web bbnet     build    client   configure  configure.server  CREDITS  docs    include  pkg  README.CLIENT  rpm [tjyang@fc6 trunk]$ history |grep commit 1159 svn commit -m "T.J. Yang's copy of hobbit" 1217 history |grep commit 1240 history |grep commit [tjyang@fc6 trunk]$ svn commit -m "add pkg directory" Sending       trunk/README Adding        trunk/pkg Adding        trunk/pkg/tww Transmitting file data. Committed revision 5646. [tjyang@fc6 trunk]$
 * creating a subdirectory.

Henrik, Feb 9 2009
On February 9, Henrik posted the following roadmap to the list. I haven't heard much lately so I don't know if it has changed.

Version 4.4:
 * SNMP support for data collection
 * Status updates based on data collected in the RRD files (this is really nice - essentially, *any* value you put into an RRD file can trigger a new or modified status in Xymon. So you could eg. change the status of your "http" test to go red, if the response time of a webpage exceeds 5 seconds).
 * Status "flap" handling, to catch statuses that change rapidly.

Version 4.5:
 * Support for communication between clients and Xymon to use compression and/or encryption.
 * Support for client authentication via SSL certificates (so you cannot spoof a client message).

Version 4.6:
 * Revised web interface - eliminate the need for webserver-based authentication, and provide more fine-grained authorization for the various Xymon components.
 * Per-user custom login pages, so the login will always show those systems that the user has responsibility for / is allowed to access.

Somewhere along the road I will also introduce a new "ping" test daemon - I am getting to the point where ping'ing all hosts take longer than 5 minutes (I have a lot of hosts). So something needs to be done, and I think I know how to do it.

Todos
Tasks that most team member agree to implement.

Design Document
Hobbit Design Document

Wish Lists

 * Test Suite for software quality assurance.
 * Migrate all the bb modules from deadcat.net to hobbit.
 * SLA Report built in.
 * Better Theme support.
 * Provide encrypted communication pipe between hobbit server and hobbit client.
 * hobbit messages compression.
 * ipv6
 * 4.2.x maintenance release.
 * Rewrite of the alerts module to work properly. ;) It's quite flawed at the moment.

Xymon volunteers Roles and Responsibility
This is a list of people offer their time and skill to Xymon community in following areas of R&R.
 * 1) Project Admin
 * 2) Has right as project admin on sourceforge.
 * 3) Assign tickets to different persons listed below.
 * 4) Grant new developer privilege on sourceforge.
 * 5) Get people to work as a team with limited and un-paid  resources.
 * 6) Development
 * 7) Understand Xymon source tree.
 * 8) Do source code documentation.
 * 9) Work on ticket from issue tracker.
 * 10) Apply patches submitted from the Xymon community.
 * 11) Implement new requested features
 * 12) Documentation
 * 13) Keep troff files updated with Xymon features.
 * 14) maintain troff2html process.
 * 15) Create a publish-grade manuals and process for Xymon using Latex.
 * 16) use latex2troff tool to generate Xymon troff manpage sources.
 * 17) Automate the document generation in "make" command process.
 * 18) End User Support
 * 19) Answer questions raised in xymon user email list.
 * 20) Maintain Xymon FAQ.
 * 21) Test out new Xymon features or verify a bug.
 * 22) Module Development
 * 23) Write new Xymon client external modules.
 * 24) Write Xymon Server side external modules.
 * 25) Maintain orphan Xymon modules.
 * 26) Maintain Xymon module development guides.

Packager Who is who

 * blingme: Mandriva
 * Christoph Berg (Myon):    debian

Developers with write access

 * Henrik Stoerner: http://www.hswn.dk
 * Make Big Brother system monitor to be open again.
 * Rewrite Big Brother shell scrip part into C code to speed up the performance.
 * Amazon Wish List

 * Martin Ward

 * Rich Smrcina
 * Buchan Milne
 * T.J. Yang
 * hobbit wiki book project.
 * Autoconfiscate Hobbit.
 * Hobbit documentation project.
 * Will use latex to create hobbit manual.
 * Digitation of hobbit software build,package build and deployment process.
 * OpenSolaris VMWare appliance for Hobbit Development.
 * Using EXTJS 3.0 for hobbit menu system.

Developers

 * Vernon Everett
 * hobbit wiki and documentation.

 * Etienne GRIGNON (etienne.grignon@gmail.com )
 * BBWin: http://sourceforge.net/projects/bbwin

 * Francesco Duranti
 * Ability to patch hobbit source code.
 * http://www.hswn.dk/hobbiton/2006/10/msg00080.html

 * TWW Inc.
 * Package the hobbit client and server using TWW toolsets.

List of Names contributed to this hobbit project
Manon Goo  Alex Tang  Tim Hudson (tjh@cryptsoft.com) Steve Reid  Thomas Roessler  Wei Dai  Eric Young (eay@cryptsoft.com) Charles Goyard  Marco Avvisano Paul Backer Olivier Beau Adamets Bluejay Brian Buchanan Massimo Carnevali Douwe Dijkstra Francesco Duranti Lars Ebeling Tom Georgoulias Laurent Grilli Kevin Hanrahan Asif Iqbal Charles Jones Thomas J Jones Uwe Kirbach Joshua Krause Patrick Lin Brian Lynch Thomas Mattsson Michael Fisher Daniel J McDonald Werner Michels Christian Perrier Jure Peternel William Richardson Torsten Richter Chris Ricker Tim Rotunda Thomas Rucker Mirko Saam Thomas Schfer Tom Schmidt Eric Schwimmer Bill Simaz Gavin Stone-Tolcher Jeff Stoner David Stuffle Christian Thibodeau Rick Waegner Rob Watson

Autoconfiscate Hobbit
This section describe the conversion of hobbit source tree into autotool control.

Why the autoconfiscation ?

 * To be more portable across OS platforms.
 * Plan for I18n and L10n.
 * To become true GNU software which require use of autotool.

Learn autotool

 * the autotools tutorial and read the pdf slides.
 * hand on testing on hello world example.
 * example of using autoscan.

Convert hobbit source tree
GNU Autoconf 2.61 (November 2006) GNU Automake 1.10 (October 2006) GNU Libtool 1.5.24 (June 2007) GNU Gettext 0.17 (November 2007)
 * make sure your autotool sets has following version.
 * download the latest hobbit source tar ball.
 * run autoscan to get configure.scan and then modify it as configure.ac.
 * convert lib/Makefile demotool/Makefile ... etc into Makfile.am.
 * Fine tune configure.ac to take configuration options as configure options.
 * Support Linux and Solaris OS setting in configure.ac.

Xymon Documentation

 * 1) Current
 * 2) Henrik Stroner use troff to generate manual pages so that we have the RTFM type of documentation.
 * 3) Also troff2html is used to create html page for web browser viewing.
 * 4) Enhancements Proposals.
 * 5) Use latex+dia+make+wiki to create publishing grade docs
 * 6) Use Table of Conetent, index, references and Figures to describe Xymon related topic.
 * 7) Generate Xymon User Guide.
 * 8) Generate Xymon Developer Guide
 * 9) Generate Xymon System Admin Guide.
 * 10) Generate Xymon Slide for presentation purpose.
 * 11) Use Wiki documentation content incubation.
 * 12) Generate html.RTF and pdf for different purpose.
 * 13) Request Development Team to use doxygen syntax for source code documentation.

MediaWiki to DocBook

 * use mvc to gain hobbit wiki source
 * convert mediawiki source to latex.

Reuse content from existing hobbit documentation source

 * http://www.hswn.dk/hobbit/help/manpages/

Xymon test suite
Run through test cases to verify the code changes are ok.

shell scripts
build/perl.sh build/fping.sh            build/rrd.sh   build/ssl.sh build/ldap.sh          build/pcre.sh
 * test script in build directory of hobbit-4.0.3 to make sure depended software are in build machine.

Dtrace probes in hobbit server
An example of putting dtrace probe int an application.

Hobbit Client for OpenSolaris IPS format

 * Features of This hobbit client
 * This hobbit client will use a local account and group to avoid NIS and NFS dependency.
 * It will use SMF to start/top hobbit client.
 * It will use sudo or Solaris 10's ACL to achieve reading restricted information off OpenSolaris.
 * hobbit-client-serverconf is simple version of hobbit client without local messages processing.
 * hobbit-client-local will do some processing filtering, it need more depended software.
 * it use /opt/hobbitclient42 as installation path.
 * svcadm disable/enable network:/hobbit-client-serverconf

OpenSolaris info
-bash-3.2# uname -a SunOS opensolaris 5.11 snv_86 i86pc i386 i86pc -bash-3.2# cat /etc/release Open Solaris 2008.05 snv_86_rc2a X86 Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 23 April 2008 -bash-3.2#
 * OpenSolaris 2008.05

 * Installed Sun and SUNW gcc-3.4.3 compilers.
 * if not installed run "pkg install sunstudioexpress" and "pkg install SUNWgcc".

-bash-3.2# pkg info sunstudioexpress SUNWgcc Name: sunstudioexpress Summary: Sun Studio Express - C, C++, & Fortran compilers and Tools State: Installed Authority: opensolaris.org (preferred) Version: 0.2008.5 Build Release: 5.11 Branch: 0.86 Packaging Date: Wed Apr 30 21:10:32 2008 Size: 566.2 MB         FMRI: pkg:/sunstudioexpress@0.2008.5,5.11-0.86:20080430T211032Z

Name: SUNWgcc Summary: gcc - The GNU C compiler State: Installed Authority: opensolaris.org (preferred) Version: 3.4.3 Build Release: 5.11 Branch: 0.86 Packaging Date: Sat Apr 26 18:22:21 2008 Size: 60.4 MB         FMRI: pkg:/SUNWgcc@3.4.3,5.11-0.86:20080426T182221Z -bash-3.2#

RPM
[root] cat build/makerpm.sh
 * 1) !/bin/sh

REL=$1 if [ "$REL" = "" ]; then echo "Error - missing release number" exit 1 fi

cd ~/hobbit rm -rf rpmbuild

mkdir -p rpmbuild/RPMS rpmbuild/RPMS/i386 rpmbuild/BUILD rpmbuild/SPECS rpmbuild/SRPMS rpmbuild/SOURCES cat >rpmbuild/.rpmmacros <rpmbuild/.rpmrc <rpmbuild/SPECS/hobbit.spec cp rpm/hobbit-init.d rpmbuild/SOURCES/ cp rpm/hobbit.logrotate rpmbuild/SOURCES/

mkdir -p rpmbuild/hobbit-$REL for f in bbdisplay bbnet bbpatches bbproxy build common docs hobbitd include lib scripts do find $f/ | grep -v RCS | cpio -pdvmu ~/hobbit/rpmbuild/hobbit-$REL/ done cp -p Changes configure COPYING CREDITS README ~/hobbit/rpmbuild/hobbit-$REL/ find ~/hobbit/rpmbuild/hobbit-$REL -type d|xargs chmod 755

cd rpmbuild tar zcf SOURCES/hobbit-$REL.tar.gz hobbit-$REL rm -rf hobbit-$REL HOME=`pwd` rpmbuild -ba --clean SPECS/hobbit.spec rpm --addsign RPMS/i?86/hobbit-$REL-*.i?86.rpm mv RPMS/i?86/hobbit-$REL-*.i?86.rpm SRPMS/hobbit-$REL-*.src.rpm ../rpm/pkg/ [root]

How to participate the hobbit development

 * subscribe to hobbit mailing list
 * create an account on en.wikibooks.org to participate in hobbit documentation effort.
 * learn from http://en.wikibooks.org/wiki/CPAM_with_TWW to participate in hobbit automated cross-platform software packaging effort.

Using prebuilt OpenSoalris VMWare Image

 * Download OpenSolaris VMWare Image from here(TBA).
 * Install VMWare player 3.0 from here(TBA).

On Solaris 10 Intel
bash-3.00# which cvs /opt/csw/bin/cvs bash-3.00# uname -a SunOS unknown 5.10 Generic i86pc i386 i86pc bash-3.00# which gcc /opt/csw/gcc3/bin/gcc bash-3.00# which gmake /opt/csw/bin/gmake bash-3.00#
 * host info

Setup your TWW developement

 * download TWW tools onto your system
 * compile hobbit*.[sb|pb].

Feedback to Hobbit

 * include your fix,patch, modules addition to sourceforge.net

Hobbit server
So the core design looks like this:

Network tests --\ \           TCP:1984 \           IPC Clients --> hobbitd > hobbitd_channel ---> worker module /        Sh. mem. stdin /  Custom tests ---/

Windows Hobbit client
BB Win

Custom Monitoring Scripts for Hobbit
System Monitoring with Hobbit/HOWTO/Custom Monitoring Scripts for Hobbit http://www.hswn.dk/hobbit/help/hobbit-tips.html#scripts

Why use CPAM/TWW tool ?

 * Pros
 * Hobbit server and client need to be cross-platform thus the need of CPAM/TWW.
 * Like Emacs editor, it can will be run everywhere without license. TWW tools is GPL opensource so it can be ported to any OS.
 * A structural and automated approach to deal with packages creation and management.
 * Cons
 * Another learning curve need to climb.
 * Changing people's development habit is hard.

Supported OS

 * Solaris Sparc
 * RH AS 3.0
 * HP-UX 11.11

Hobbit client on MS windows Overview

 * 1) bbwin (Xymon client) is implemented in c++. It requires opensource software like boost c++ libary and tinyXML.
 * 2) The packaging tool it used is Microsoft's opensource packaging tool - WiXto do the Win32 packaging.
 * 3) The detals building instruction is build.txt on bbwin project site.
 * 4) You have two ways to build BBWin.msi,
 * 5) Use Microsoft's make: nmake
 * 6) Use "Build Soultion" in VS2008.

Following is a procedure to create a Windows XP development box so you can create your own BBWin.msi.

Prepare your Xymon win32 build environment
INCLUDE=C:\Program Files\Microsoft Platform SDK\Include\.; C:\Program Files\Microsoft Platform SDK\Include\atl;C:\Program Files\Microsoft Visual Studio 8\VC\include
 * 1) Install hhc.exe,it is used to compile html doc into windows chm help file.
 * 2) add "C:\Program Files\HTML Help Workshop" into PATH so hhc.exe is accessible.
 * 3) Install Visual Studio 2008 Standard or Professional Edition.
 * 4) Make sure your cmd.exe has following PATH name addition. echo %PATH% %INCLUDE% %LIB% in your DOS prompt.
 * 5) PATH
 * 6) "LIB=C:\Program Files\Microsoft Platform SDK\Lib\.;C:\Program Files\Microsoft Visual Studio 8\VC\LIB;"
 * 7) INCLUDE
 * 1) Install a svn client for your windows machine.
 * 2)  tortoise svn
 * 3) Windows Server 2003 SP1 Platform SDK Web Install: It is use to have the complete sdk to develop programs on Microsoft OS. Remeber to install all options (include 64 bit and 32 bit) to avoid "atlthunk.lib not found" issue.
 * 4) install visual service pack 1:
 * 5) MSDN blog about VS2008 and SDK
 * 6) WiX opensource packaging tool from Microsoft: this is use to turn the compiled binary into MS MSI package format.
 * 7) Boost C++ library:These powerful C++ libraries are used for some agents and will be certainly used in the BBWin core service in the future.
 * 8)  Download the pre-compiled 1.35 one for VS2008 and install it under C:\boost directory.
 * 9) TinyXML: BBWin used the excellent TinyXML library for the configuration loading XML. You do not need to download and install it. TinyXML sources are included in BBWin sources.
 * 10) Prepare your source code editors:
 * 11) notepade++:
 * 12) XEmacs for win32:

$ rm Setup/* $ rm Release/*
 * 1) checkout bbwin src.
 * 2) Using command "svn co https://bbwin.svn.sourceforge.net/svnroot/bbwin bbwin"
 * 3) Change the Makefile code for C:\boost installation.
 * 4) Modify Makefile to point INCLUDE to C:\boost and LIB to include C:\boost\lib\*.lib
 * 5) Modify C/C++ iclude c:\boost and Linker to include c:\boost\lib\*.
 * 6) Optional software installation
 * 7) install cygwin to have a strong unix enviroment on your windows box. So you can run command like following to clean up *.obj file that current makefile can't do.
 * 8) Clean up Release directory by Deleting Setup/*.msi

Build the bbwin using command line approach
BBWin.msi creation process is automated in "C:\BBWin\trunk\Setup\Makefile". This makefile will be called from "C:\BBWin\trunk\Makefile" C:\bbwin-src\trunk>nmake -help
 * Make sure your nmake command is available.

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved.

Usage: NMAKE @commandfile NMAKE [options] [/f makefile] [/x stderrfile] [macrodefs] [targets]

Options:

/A Build all evaluated targets /B Build if time stamps are equal /C Suppress output messages /D Display build information /E Override env-var macros /ERRORREPORT:{NONE|PROMPT|QUEUE|SEND} Report errors to Microsoft /G Display !include filenames /HELP Display brief usage message /I Ignore exit codes from commands /K Build unrelated targets on error /N Display commands but do not execute /NOLOGO Suppress copyright message /P Display NMAKE information /Q Check time stamps but do not build /R Ignore predefined rules/macros /S Suppress executed-commands display /T Change time stamps but do not build /U Dump inline files /Y Disable batch-mode /? Display brief usage message

C:\bbwin-src\trunk>
 * cd to c:\bbwin top source directory.
 * type "nmake" to kick off the build.

atlbase.h not found
C:\bbwin\trunk\Core\Agents\common>nmake
 * Error message

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved.

cl -Zi -Od -DDEBUG -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_X 86_=1 -DWIN32 -D_WIN32 -W3 -D_WINNT -D_WIN32_WINNT=0x0500 -DNTDDI_VERSION=0x050 00000 -D_WIN32_IE=0x0500 -DWINVER=0x0500 /EHsc /I ../.. /I C:\boost\include\boos t-1_33_1 -D_MT -MTd SystemCounters.cpp SystemCounters.cpp SystemCounters.cpp(20) : fatal error C1083: Cannot open include file: 'atlbase.h ': No such file or directory NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN \cl.EXE"' : return code '0x2' Stop.

C:\bbwin\trunk\Core\Agents\common> C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\atlbase.h
 * make sure you have following directory and file, if not then you need to use VS non-Express version.
 * Possible fix

Temporary Fix for following

 * Goal is to get rid of " -D_MT -MTd" when using cl MS compiler.
 * Run this command in cygwin shell on your codebase, "find . -type f -name Makefile -exec perl -pi -e 's!cvarsmt!conlibsdll!' {} \;", to replace cvarsmt with conlibsdll. I don't know the exact impact of not building code with multihreading library.

* LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
link /DLL procs.obj procs.res -out:procs.dll /LIBPATH:C:\boost\lib libboost_date_time-vc80-mt-s.lib Microsoft (R) Incremental Linker Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved.
 * C:\bbwin09\trunk\Core\Agents\procs *** "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" -nologo /L

LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in LIBCMTD.lib(invarg.obj) Creating library procs.lib and object procs.exp LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library procs.dll : fatal error LNK1169: one or more multiply defined symbols found NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.EXE"' : return code '0x491' Stop.
 * C:\bbwin09\trunk\Core\Agents\sample *** "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" -nologo /L
 * C:\bbwin09\trunk\Core\Agents\bbwinupdate *** "C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" -nologo /L

C:\bbwin09\trunk\Core> C:\bbwin09\trunk\Core\Agents\procs>nmake clean nmake clean
 * http://msdn.microsoft.com/en-us/library/Aa267384
 * Possible fix with similar issue.
 * vc6 to vc8.
 * Try to link with "/NODEFAULTLIB:library".

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved.

erase /Q /S procs.res procs.obj procs.dll procs.exp procs.lib procs.obj Deleted file - C:\bbwin09\trunk\Core\Agents\procs\procs.res Deleted file - C:\bbwin09\trunk\Core\Agents\procs\procs.obj Deleted file - C:\bbwin09\trunk\Core\Agents\procs\procs.exp Deleted file - C:\bbwin09\trunk\Core\Agents\procs\procs.lib

C:\bbwin09\trunk\Core\Agents\procs>nmake nmake

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved.

cl -Zi -Od -DDEBUG -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -D_X86_=1 -DWIN32 -D_WIN32 -W3 -D_WINNT -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DWINVER=0x0500 /EHsc /I ../.. /I ../common /I C:\boost\include\boost-1_33_1 -D_MT -MTd procs.cpp procs.cpp C:\boost\include\boost-1_33_1\boost/date_time/c_time.hpp(68) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(114) : see declaration of 'localtime' C:\boost\include\boost-1_33_1\boost/date_time/c_time.hpp(75) : warning C4996: 'gmtime': This function or variable may be unsafe. Consider using gmtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. C:\Program Files\Microsoft Visual Studio 8\VC\include\time.inl(101) : see declaration of 'gmtime' C:\boost\include\boost-1_33_1\boost/utility/enable_if.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/lexical_cast.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/utility/enable_if.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/type_traits/is_base_and_derived.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/lexical_cast.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/tokenizer.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/lexical_cast.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/lexical_cast.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/tokenizer.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/lexical_cast.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/format/internals.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/format/alt_sstream_impl.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/format/internals.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss C:\boost\include\boost-1_33_1\boost/format/alt_sstream_impl.hpp(252) : warning C4996: 'std::char_traits ::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' C:\Program Files\Microsoft Visual Studio 8\VC\include\iosfwd(446) : see declaration of 'std::char_traits ::copy' C:\boost\include\boost-1_33_1\boost/format/alt_sstream_impl.hpp(223) : while compiling class template member function 'int boost::io::basic_altstringbuf::overflow(int)' with [           Ch=char, Tr=std::char_traits , Alloc=std::allocator ]       C:\boost\include\boost-1_33_1\boost/format/format_class.hpp(136) : see reference to class template instantiation 'boost::io::basic_altstringbuf' being compiled with [           Ch=char, Tr=std::char_traits , Alloc=std::allocator ]       procs.cpp(235) : see reference to class template instantiation 'boost::basic_format' being compiled with [           Ch=char ]	Rc /r -DWIN32 -D_WIN32 -DWINVER=0x0500 -DDEBUG -D_DEBUG /fo procs.res procs.rc	link /NODEFAULTLIB:library  procs.obj procs.res -out:procs.dll /LIBPATH:C:\boost\lib libboost_date_time-vc80-mt-s.lib Microsoft (R) Incremental Linker Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved.

LIBCMT.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj) LIBCMT.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in LIBCMTD.lib(invarg.obj) Creating library procs.lib and object procs.exp LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup procs.dll : fatal error LNK1120: 1 unresolved externals NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.EXE"' : return code '0x460' Stop.

C:\bbwin09\trunk\Core\Agents\procs>

build the bbwin using GUI approach
follow text will turn into wiki procedure above. Build file for BBWin 2 ==============================================================   3     4 This file explains you how to build BBWin from the sources. 5    6     7 Getting the last sources 8 ========================   9    10 BBWin is developped in C++ (the Standard Template Library and the Standard C++ Library   11 are used) 12 The source of BBWin are available from the sourceforge subversion 13 repository for the BBWin projects : 14 http://svn.sourceforge.net/viewcvs.cgi/bbwin/ 15   16    17 Install the tools 18 =================  19    20 BBWin has been developped thanks to many tools. You should install them to   21 build BBWin easily without troubles. 22   23 Windows Platform SDK 2003 : it is used for the development environment. 24 It is use to have the complete sdk to develop programs on Microsoft OS. 25 You can download it for free from microsoft website : 26 http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en 27 You will need 1 gb of free space if you install every thing :)
 * check out the source code
 * open up bbwin.sln

28 BBWin Makefiles are using the nmake tool and Makefile templates from the SDK. 29 This SDK is very important for anyone who would like to start developing under Windows. 30   31 Visual C++ Toolkit : it is the compiler used to build the bbwin release 32 It is the original compiler from Visual Studio 2003 Professional (Code optimisation is included) 33 You can download it for free from the Microsoft website : 34 http://msdn.microsoft.com/visualc/vctoolkit2003/ 35   36 Wix Toolkit : this package is used to build the BBWin MSI installer 37 You should install it and have the bin directory in your current path 38 http://sourceforge.net/projects/wix/ 39   40 TinyXML : BBWin used the excellent TinyXML library for the configuration loading XML. 41 You do not need to install it. TinyXML sources are included in BBWin sources. 42   43 Boost Lib : These powerful C++ libraries are used for some agents and will be   44 certainly used in the BBWin core service in the future. 45 You should get the boost C++ from the website : 46 http://www.boost.org/ 47 Build it in the directory C:\boost so you won't have to change BBWin Makefiles. 48 If you want to build BBWin with Visual C++ Express 2005, please read the following page : 49 http://www.boost.org/tools/build/v1/vc-8_0-tools.html 50   51    52 I recommand you the Notepad++ editor if you are looking for a nice free code editor. 53 You can download it from : 54 http://notepad-plus.sourceforge.net 55   56    57    58 Building the BBWin with Visual C++ Express 2005 59 ===============================================  60    61 Open the BBWin.sln file at the top directory of the project 62 First, you should prepare your Visual C++ configuration by adding 63 in the default bin, include and lib directories the different directories from : 64   65 - the platform SDK 66 - the boost libraries 67   68 Then just build the solution. 69   70    71 Building the BBWin with Visual C++ ToolKit 2003 72 ===============================================  73    74 Open a Platform SDK Build command line environment (installed with the Platform SDK) 75 Go the top directory of the BBWin source tree 76 Type nmake 77 Go get a cup of coffee 78 It's ready ! 79   80 If you get errors, it may be due to some errors in your include or lib path. 81 Make sure the environment variables %Lib%; %Path% and %Include% are correctly 82 configured. You may need to add some directories. 83   84 Building process order 85 ======================  86    87 1) BBWin core service   88 2) Agents 89 3) Externals (needing compilation)  90 4) Setup MSI 91

C:\tmp\test\trunk\Setup>nmake clean
 * Example of using nmake to create a BBwin.msi

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved.

erase /q /s BBWin.dll BBWin.exp UpgradeConfiguration.obj BBWin.res BBWin .wixobj BBWin.msi BBWin.lib Deleted file - C:\tmp\test\trunk\Setup\BBWin.wixobj Deleted file - C:\tmp\test\trunk\Setup\BBWin.msi

C:\tmp\test\trunk\Setup>nmake

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved.

candle /nologo BBWin.wxs BBWin.wxs light /nologo BBWin.wixobj

C:\tmp\test\trunk\Setup>

How to use hobbit-4.0.3.sb build source ?

 * hobbit-4.0.3.sb is an XML file contain the detail exact steps to build hobbit-4.03. into binary code for different OS. It need to be run against "sb" tool.
 * TBA.

The source : hobbit-4.0.3.sb
[root] cat hobbit-4.0.3.sb   hobbit-4.0.3</build-name> <install-name>hobbit</install-name> <syntaxhighlight path="src/hobbit-4.0.3.tar.gz" /> fping24 <depend var="APACHESS">apacheS2048 <depend var="RRDTOOL">rrdtool10 <depend var="PCRE">libpcre44 <depend var="OPENSSL">libopenssl097 <depend var="OPENLDAP">openldap2127 <![CDATA[ case "${SB_SYSTYPE}" in   *-hpux11.11)      ;;    *-hpux10.20) ;;   *-linux*)     ;;    *-solaris2*) ;;   esac set -x rm -f Makefile TARGET=hobbit \ ENABLESSL=y \ ENABLELDAP=y \ ENABLELDAPSSL=y \ BBUSER=hobbit \ BBTOPDIR=/opt/TWWfsw/hobbit \ BBVAR=/var/opt/TWWfsw/hobbit/data \ BBHOSTURL=/hobbit \ CGIDIR=/etc/opt/TWWfsw/apacheS2048/cgi-bin \ BBCGIURL=/hobbit-cgi \ SECURECGIDIR=/etc/opt/TWWfsw/apacheS2048/cgi-secure \ SECUREBBCGIURL=/hobbit-seccgi \ HTTPDGID=il02w-web \ BBLOGDIR=/var/opt/TWWfsw/hobbit/log/hobbit \ BBHOSTNAME=localhost \ BBHOSTIP=127.0.0.1 \ MANROOT=/opt/TWWfsw/hobbit/man \ BARS=all \ USENEWHIST=y \ PIXELCOUNT=960 \ MAKE=/opt/TWWfsw/bin/gmake \ INSTALLBINDIR=/opt/TWWfsw/hobbit/server/bin \ INSTALLETCDIR=/opt/TWWfsw/hobbit/server/etc \ INSTALLWEBDIR=/opt/TWWfsw/hobbit/web \ INSTALLEXTDIR=/opt/TWWfsw/hobbit/server \ INSTALLTMPDIR=/var/opt/TWWfsw/hobbit/tmp \ INSTALLWWWDIR=/opt/TWWfsw/hobbit/server/www ./configure \ --rrdinclude /opt/TWWfsw/rrdtool10/include  \ --rrdlib     /opt/TWWfsw/rrdtool10/lib       \ --pcreinclude /opt/TWWfsw/libpcre44/include  \ --pcrelib    /opt/TWWfsw/libpcre44/lib       \ --sslinclude /opt/TWWfsw/libopenssl097/include    \ --ssllib     /opt/TWWfsw/libopenssl097/lib      \ --ldapinclude /opt/TWWfsw/openldap2127/include    \ --ldaplib    /opt/TWWfsw/openldap2127/lib     \ --fping      /opt/TWWfsw/fping24/sbin/fping

]]>

<![CDATA[ case "${SB_SYSTYPE}" in gmake ;; ;; gmake ;; gmake ;; esac ]]> <![CDATA[ case "${SB_SYSTYPE}" in gmake install ;; ;; gmake install ;; LD_LIBRARY_PATH=/opt/TWWfsw/libopenssl097/lib export LD_LIBRARY_PATH gmake install ;; esac
 * -hpux11.11)
 * -hpux10.20)
 * -linux*)
 * -solaris2.[689])
 * 1) building hobbit on different OS
 * 1) building hobbit on different OS
 * -hpux11.11)
 * -hpux10.20)
 * -linux*)
 * -solaris2.[689])
 * 1) create man directory for TWW
 * 2) ln -s /opt/TWWfsw/hobbit/server/bin /opt/TWWfsw/hobbit/bin
 * 3) mkdir -p /opt/TWWfsw/hobbit/man
 * 4) cp -rp /opt/TWWfsw/hobbit/server/www/help/manpages/* /opt/TWWfsw/hobbit/man

]]>

<![CDATA[ set -x rm -rf /opt/TWWfsw/hobbit rm -rf /etc/opt/TWWfsw/apacheS2048/cgi-secure rm -rf /etc/opt/TWWfsw/apacheS2048/cgi-bin/bb-* rm -rf /etc/opt/TWWfsw/apacheS2048/cgi-bin/hobbit* rm -rf /var/opt/TWWfsw/hobbit ]]>

This sb file is to digitalize the hobbit software build process for different OS. Original: 05/26/2005 T.J.Yang tj_yang at hotmail do com

[root]

hobbit-4.0.3.pb
[root] cat hobbit-4.0.3.pb <?xml version="1.0"?> <package name="hobbit" version="4.0.3" revision="1"> <package-manager name="depot"> hobbit GPL <install-name>hobbit</install-name> <pkgname-base>TWWhobbit</pkgname-base>

4.0.3      1     </package-manager>

<package-manager name="rpm4"> System Environment/Daemons Hobbit System Monitoring Tool GNU Hobbit System Monitoring tool. An open-source version of Big Brother. <install-name>hobbit</install-name> <pkgname-base>TWWhobbit</pkgname-base> <init name="/etc/init.d/TWWhobbit" path="pkg/hobbit-init-linux" /> <init link-src="/etc/rc2.d/S661hobbit" link-dest="/etc/init.d/TWWhobbit"/> <init link-src="/etc/rc1.d/K269hobbit" link-dest="/etc/init.d/TWWhobbit"/> /etc/init.d/TWWhobbit 4.0.3      1       <depend pkgname-base="TWWperl561" title="perl 5.6.1" subpkg="runtime">v>=5.6.1 r>=1 <depend pkgname-base="TWWrrdtool10" title="Round Robin Database" subpkg="runtime">v>=1.0.42 <depend pkgname-base="TWWrrdtool10" title="Round Robin Database" subpkg="man">v>=1.0.42

<depend pkgname-base="TWWhobbit" title="Client: Big Brother System Monitoring Tool" subpkg="runtime">v>=4.0.3 <postinstall path="pkg/postinstall-linux" /> <preremove  path="pkg/preremove-linux" /> <postremove path="pkg/postremove-linux" />

</package-manager> [root]

Hobbit Required Packages
fping24 <depend var="APACHESS">apacheS2048 <depend var="RRDTOOL">rrdtool10 <depend var="PCRE">libpcre44 <depend var="OPENSSL">libopenssl097 <depend var="OPENLDAP">openldap2127
 * fping
 * apache web server
 * rrdtool
 * pcre
 * openssl
 * openldap
 * following is the listing of exact version to build hobbit-4.0.3

Following diagram list out all the hobbit depended software by GraphViz
TBA.

Create a firefox search engine plugin for hobbit server

 * References: http://mycroft.mozdev.org/deepdocs/deepdocs.html

Using relational DBs with Xymon Server
The default database back end of Xymon is RRD(Roun-Robin Database).

SQLite3

 * Almost as fast as C fopen function code.
 * No server process, data are store in plain files.
 * Just like another rrd file that can be rsynced over to your standby xymon server.

MySql

 * light weight DB.

Inventory Monitoring

 * Store a machine's asset information
 * Serial Number
 * OS type
 * Computer Maker
 * Leased/owned
 * Trigger an alert if leasing is expiring soon.
 * Display pie chart of OS type,Makers ... etc.

bb-hosts generation

 * bb-hosts files got generated from host database table.

Bill of Materials

 * Catalyst Book 1
 * perl-5.10.0
 * Fedora 11
 * Address Book Example in Book 1.
 * SQLite3
 * Catalyst::Runtime,Catalyst::Plugins::*,Catalyst::Devel.
 * Sql files to create Asset schema.

Procedures
[tjyang@t-fedora11 test]$ catalyst.pl xymonasset created "xymonasset" created "xymonasset/script" created "xymonasset/lib" created "xymonasset/root" created "xymonasset/root/static" created "xymonasset/root/static/images" created "xymonasset/t" created "xymonasset/lib/xymonasset" created "xymonasset/lib/xymonasset/Model" created "xymonasset/lib/xymonasset/View" created "xymonasset/lib/xymonasset/Controller" created "xymonasset/xymonasset.conf" created "xymonasset/lib/xymonasset.pm" created "xymonasset/lib/xymonasset/Controller/Root.pm" created "xymonasset/README" created "xymonasset/Changes" created "xymonasset/t/01app.t" created "xymonasset/t/02pod.t" created "xymonasset/t/03podcoverage.t" created "xymonasset/root/static/images/catalyst_logo.png" created "xymonasset/root/static/images/btn_120x50_built.png" created "xymonasset/root/static/images/btn_120x50_built_shadow.png" created "xymonasset/root/static/images/btn_120x50_powered.png" created "xymonasset/root/static/images/btn_120x50_powered_shadow.png" created "xymonasset/root/static/images/btn_88x31_built.png" created "xymonasset/root/static/images/btn_88x31_built_shadow.png" created "xymonasset/root/static/images/btn_88x31_powered.png" created "xymonasset/root/static/images/btn_88x31_powered_shadow.png" created "xymonasset/root/favicon.ico" created "xymonasset/Makefile.PL" created "xymonasset/script/xymonasset_cgi.pl" created "xymonasset/script/xymonasset_fastcgi.pl" created "xymonasset/script/xymonasset_server.pl" created "xymonasset/script/xymonasset_test.pl" created "xymonasset/script/xymonasset_create.pl" [tjyang@t-fedora11 test]$ catalyst.pl [tjyang@t-fedora11 xymonasset]$ perl Makefile.PL include /var/www/html/test/xymonasset/inc/Module/Install.pm include inc/Module/Install/Metadata.pm include inc/Module/Install/Base.pm Cannot determine perl version info from lib/xymonasset.pm include inc/Module/Install/Catalyst.pm include inc/Module/Install/Makefile.pm Please run "make catalyst_par" to create the PAR package! include inc/Module/Install/Scripts.pm include inc/Module/Install/AutoInstall.pm include inc/Module/Install/Include.pm include inc/Module/AutoInstall.pm [Core Features] - Catalyst::Runtime               ...loaded. (5.71001 >= 5.71001) - Catalyst::Plugin::ConfigLoader  ...loaded. (0.22) - Catalyst::Plugin::Static::Simple ...loaded. (0.20) - Catalyst::Action::RenderView    ...loaded. (0.09) - parent                          ...loaded. (0.221) - Config::General                 ...loaded. (2.42) include inc/Module/Install/WriteAll.pm include inc/Module/Install/Win32.pm include inc/Module/Install/Can.pm include inc/Module/Install/Fetch.pm Writing Makefile for xymonasset Writing META.yml [tjyang@t-fedora11 xymonasset]$
 * Use catalyst.pl to initiate your MVC project with sample templates.
 * perl Makefile.PL
 * Module::Install::Catalyst
 * Module::Install::Catalyst finished.
 * Module::AutoInstall version 1.03
 * Checking for Perl dependencies...
 * Module::AutoInstall configuration finished.

Upgrade Xymon Web GUI
Current Xymon(Hobbit) is coded in C and using CGI and html code to compose a simple web interface. Recently, we have a few javascript framework choices to upgrade xymon server with RIA web interface.

Using qwikioffice for Xymon Dashboard

 * qwikioffice Demo Site

Using Tomatocart's admin tool for Xymon administration tool

 * Xymon Admin Interface

Replace Xymon C/CGI with C/EXTJS

 * JSON in C

Possible Solutions
find. -type f -name "*.[c|h]" -exec perl -pi -e 's!unsigned\schar!char!g' {} \;
 * To remove "unsigned char" usage hobbit src tree.
 * To cast the char that need to be unsigned.

GCC Compilation Warnings

 * pointer targets in assignment differ in signedness
 * Why use unsigned char ?
 * char-vs-unsigned-char
 * "/usr/include/sys/socket.h:214: note: expected socklen_t * __restrict__ but argument is of type int *"

Compilation Warning on 4.3.0 C source code example listing
[tjyang@f12 4.3.0]$ gmake MAKE="gmake" CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I`pwd`/include -DCLIENTONLY=1" LDFLAGS="" `pwd`/build/genconfig.sh Checking for socklen_t Checking for snprintf Checking for vsnprintf Checking for rpc/rpcent.h Checking for sys/select.h Checking for u_int32_t typedef Checking for PATH_MAX definition Checking for SHUT_RD/WR/RDWR definitions Checking for strtoll config.h created gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -I. -I../include   -c -o digest.o digest.c digest.c: In function âmd5hashâ: digest.c:40: warning: pointer targets in passing argument 2 of âmyMD5_Updateâ differ in signedness /home/tjyang/hobbitmon/branches/4.3.0/include/../lib/md5.h:18: note: expected âunsigned char *â but argument is of type âchar *â gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -I. -I../include   -c -o encoding.o encoding.c encoding.c: In function âbase64encodeâ: encoding.c:31: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness /usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:34: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness /usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:50: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness /usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:60: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness /usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:75: warning: pointer targets in return differ in signedness encoding.c: In function âbase64decodeâ: encoding.c:86: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness /usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:114: warning: pointer targets in return differ in signedness encoding.c: In function âgetescapestringâ: encoding.c:125: warning: pointer targets in assignment differ in signedness encoding.c: In function ânlencodeâ: encoding.c:181: warning: pointer targets in assignment differ in signedness encoding.c:183: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness /usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:187: warning: pointer targets in assignment differ in signedness encoding.c:191: warning: pointer targets in assignment differ in signedness encoding.c:198: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness encoding.c:198: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:198: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness /usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:198: warning: pointer targets in passing argument 1 of â__strcspn_c1â differ in signedness /usr/include/bits/string2.h:971: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:198: warning: pointer targets in passing argument 1 of â__strcspn_c2â differ in signedness /usr/include/bits/string2.h:982: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:198: warning: pointer targets in passing argument 1 of â__strcspn_c3â differ in signedness /usr/include/bits/string2.h:994: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:198: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness encoding.c:198: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:198: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness encoding.c:198: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c: In function ânldecodeâ: encoding.c:231: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness encoding.c:231: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:231: warning: pointer targets in passing argument 1 of âstrlenâ differ in signedness /usr/include/string.h:397: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:231: warning: pointer targets in passing argument 1 of â__strcspn_c1â differ in signedness /usr/include/bits/string2.h:971: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:231: warning: pointer targets in passing argument 1 of â__strcspn_c2â differ in signedness /usr/include/bits/string2.h:982: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:231: warning: pointer targets in passing argument 1 of â__strcspn_c3â differ in signedness /usr/include/bits/string2.h:994: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:231: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness encoding.c:231: note: expected âconst char *â but argument is of type âunsigned char *â encoding.c:231: warning: pointer targets in passing argument 1 of â__builtin_strcspnâ differ in signedness encoding.c:231: note: expected âconst char *â but argument is of type âunsigned char *â loadhosts.c: In function âbbh_find_itemâ: loadhosts.c:228: warning: return discards qualifiers from pointer target type loadhosts.c: In function âbbh_itemâ: loadhosts.c:540: warning: pointer targets in passing argument 1 of ânlencodeâ differ in signedness /home/tjyang/hobbitmon/branches/4.3.0/include/../lib/encoding.h:17: note: expected âunsigned char *â but argument is of type âchar *â loadhosts.c:540: warning: pointer targets in passing argument 2 of âaddtobufferâ differ in signedness /home/tjyang/hobbitmon/branches/4.3.0/include/../lib/strfunc.h:16: note: expected âchar *â but argument is of type âunsigned char *â loadhosts.c: In function âbbh_item_idâ: loadhosts.c:619: warning: return discards qualifiers from pointer target type msort.c: In function âmsortâ: msort.c:119: warning: passing argument 4 of âqsortâ from incompatible pointer type /usr/include/stdlib.h:756: note: expected â__compar_fn_tâ but argument is of type âint (*)(void **, void **)â sha2.c: In function âmySHA224_Finalâ: sha2.c:972: warning: pointer targets in passing argument 2 of âsha224_finalâ differ in signedness sha2.c:812: note: expected âunsigned char *â but argument is of type âchar *â sha2.c: In function âmySHA256_Finalâ: sha2.c:977: warning: pointer targets in passing argument 2 of âsha256_finalâ differ in signedness sha2.c:417: note: expected âunsigned char *â but argument is of type âchar *â gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -I. -I../include   -c -o sig.o sig.c gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -I. -I../include -DCLIENTONLY -c -o timefunc-client.o timefunc.c ar cr hobbitclient.a osdefs.o cgiurls.o color-client.o digest.o encoding.o environ-client.o errormsg.o holidays.o ipaccess.o loadhosts.o md5.o memory.o misc.o msort.o rbtr.o rmd160c.o sendmsg.o sha1.o sha2.o sig.o stackio.o strfunc.o suid.o timefunc-client.o ranlib hobbitclient.a || echo "" gmake[1]: Leaving directory `/home/tjyang/hobbitmon/branches/4.3.0/lib' CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I`pwd`/include -DCLIENTONLY=1" LDFLAGS="" RPATHOPT="-Wl,--rpath," SSLFLAGS="" SSLINCDIR="" SSLLIBS="" NETLIBS="" LIBRTDEF="-lrt" BBHOME="/home/xymon/client" gmake -C common client gmake[1]: Entering directory `/home/tjyang/hobbitmon/branches/4.3.0/common' gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -c -o bbdigest.o bbdigest.c bbdigest.c: In function âmainâ: bbdigest.c:48: warning: pointer targets in passing argument 2 of âdigest_dataâ differ in signedness /home/tjyang/hobbitmon/branches/4.3.0/include/../lib/digest.h:26: note: expected âunsigned char *â but argument is of type âchar *â gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -o ../client/bbdigest bbdigest.o ../lib/hobbitclient.a -lrt gmake[1]: Leaving directory `/home/tjyang/hobbitmon/branches/4.3.0/common' CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I`pwd`/include -DCLIENTONLY=1" LDFLAGS="" RPATHOPT="-Wl,--rpath," SSLLIBS="" NETLIBS="" LIBRTDEF="-lrt" BBHOME="/home/xymon/client" gmake -C build all gmake[1]: Entering directory `/home/tjyang/hobbitmon/branches/4.3.0/build' gcc -o merge-lines -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 merge-lines.c gcc -o merge-sects -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 merge-sects.c gcc -o setup-newfiles -g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I/home/tjyang/hobbitmon/branches/4.3.0/include -DCLIENTONLY=1 -Wl,--rpath, setup-newfiles.c ../lib/hobbitclient.a  -lrt setup-newfiles.c: In function âmainâ: setup-newfiles.c:27: warning: pointer targets in assignment differ in signedness setup-newfiles.c:79: warning: pointer targets in passing argument 1 of âstrstrâ differ in signedness /usr/include/string.h:340: note: expected âconst char *â but argument is of type âunsigned char *â gmake[1]: Leaving directory `/home/tjyang/hobbitmon/branches/4.3.0/build' CC="gcc" CFLAGS="-g -O2 -Wall -Wno-unused -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLINUX -I. -I`pwd`/include -DCLIENTONLY=1" BBHOME="/home/xymon/client" BBHOSTIP="127.0.0.1" LOCALCLIENT="no" NETLIBS="" LIBRTDEF="-lrt" gmake -C client all gmake[1]: Entering directory `/home/tjyang/hobbitmon/branches/4.3.0/client' msgcache.c: In function âmainâ: msgcache.c:537: warning: pointer targets in passing argument 3 of âacceptâ differ in signedness /usr/include/sys/socket.h:214: note: expected âsocklen_t * __restrict__â but argument is of type âint *â cat hobbitclient.cfg.DIST | sed -e 's!@BBHOSTIP@!127.0.0.1!g' >hobbitclient.cfg ../build/bb-commands.sh >>hobbitclient.cfg cat clientlaunch.cfg.DIST | sed -e 's!@CLIENTFLAGS@!!g' >clientlaunch.cfg gmake[1]: Leaving directory `/home/tjyang/hobbitmon/branches/4.3.0/client'

Build complete. Now run 'gmake install' as root

[tjyang@f12 4.3.0]$

GUI Requirements

 * 1) Keep cgi+html+tigramenu for legacy support.
 * 2) Include modern Javascript GUI framework like extjs or jQuery.
 * 3) Provide realtime web GUI update from clients using AJAX.
 * 4) Waiting for 1+ minutes to see the changes from web page is barely acceptable but hope to avoid.

From Neil Franken

 * 1) Use CSS to provide easy theme and resolution change.
 * 2) Resolutions:
 * 3) Themes:
 * 4) Enable fine-grained control on columns in different views.

From T.J. Yang
I found following combination of existing opensource software can make up a new GUI for Xymon. End user can still see old cgi+html GUI.
 * 1) Use extjs for new GUI and miframe.js to contain old tigra menu GUI in a frame.
 * 2) See Xymon Desktop Prototype.

Installation of mediawiki client in perl

 * Mediawik command line tool
 * A makefile script to automate the hobbit documentation effort.


text:
International Relations/International Organisations

An international organization (also called intergovernmental organization) is an organization of international scope or character. There are two main types of international organizations: international intergovernmental organizations, whose members are sovereign states; and non-governmental organizations (NGOs), which are private organizations. Generally the term international organization is used to mean international governmental organizations only. It is in this sense that the term is used in the remainder of this article.

Legally speaking, an international organization must be established by a treaty providing it with legal recognition. International organizations so established are subjects of international law, capable of entering into agreements among themselves or with states. Thus international organizations in a legal sense are distinguished from mere groupings of states, such as the G-8 and the G-77, neither of which have been founded by treaty, though in non-legal contexts these are sometimes referred to as international organizations as well. International organizations must also be distinguished from treaties; while all international organizations are founded on a treaty, many treaties (e.g., the North American Free Trade Agreement (NAFTA)) do not establish an international organization and rely purely on the parties for their administration.

International organizations can be categorised in two main ways: by their membership, and by their function.

International organizations differ in who their members are and in who is permitted to join them. Membership of some organizations (global organizations) is open to all the nations of the world. This category includes the United Nations and its specialized agencies, as well as the World Trade Organization.

Some specialized agencies predate all other types. In the nineteenth century, France was the fons et origo of many of them. By this it is meant that much of the driving force to form such bodies (such as those which maintain the metric system) came from the French, and that their headquarters is in France, often in Paris. Under the Third Republic, the International Exposition of 1878 in that city held a great number of meetings of such international organizations - as opposed to the preceding regimes. The motivation was that to keep France a republic and not slip back into either a monarchist or Bonapartist regime, the republicans would underscore their inheritance of the crusading nature of the French Revolution against feudal cultural remnants within France, which had been generalized to the rest of feudal Europe, eventually to the world. Some conclude from this example that internationalism often has national origins, at the difference of globalism.

Other organizations are only open to members from a particular region of the world. Finally, some organizations base their membership on other criteria: cultural or historical links (the Commonwealth of Nations, La Francophonie), level of economic development or type of economy (Organisation for Economic Co-operation and Development (OECD), Organization of Petroleum-Exporting Countries (OPEC)), or religion (Organization of the Islamic Conference).

Were it to come about, the ultimate international organization would be a federal world government.

Examples of global organizations

 * United Nations, its specialized agencies, and associated organizations
 * International Hydrographic Organization
 * World Trade Organization
 * Universal Postal Union

Examples of regional organizations

 * Europe: European Union (EU), Council of Europe, European Space Agency, European Free Trade Association, European Patent Organisation
 * America: Organization of American States (OAS), South American Community of Nations, Mercosur, Andean Community, Caribbean Community (CARICOM), Organisation of Eastern Caribbean States (OECS), Rio Group, Central American Parliament
 * Africa: the African Union (formerly the Organization for African Unity), Conseil de l'Entente, Economic Community of West African States (ECOWAS), Southern African Development Community (SADC)
 * Asia: Asian Cooperation Dialogue (ACD), Association of Southeast Asian Nations (ASEAN), South Asian Association for Regional Cooperation (SAARC), Gulf Cooperation Council

 * Trans-atlantic: North Atlantic Treaty Organisation (NATO), Organization for Security and Co-operation in Europe (OSCE)
 * Eurasian: Commonwealth of Independent States (CIS), Shanghai Cooperation Organization (SCO), Eurasian Economic Community
 * Pacific: Asia-Pacific Economic Cooperation (APEC), Pacific Islands Forum

Organizations formed on miscellaneous membership criteria

 * Organisation for Economic Co-operation and Development (OECD)
 * Organization of Petroleum-Exporting Countries (OPEC)
 * Commonwealth of Nations
 * La Francophonie
 * Comunidade dos países de língua portuguesa
 * Unión Latina
 * Non-Aligned Movement
 * Arab League
 * Organization of the Islamic Conference
 * Sister Cities International

International organizations can also be considered functionally, based on the areas and fields in which they operate.

Financial international organizations

 * Bank for International Settlements

The Union of International Associations provides information on international organizations.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
International Relations/World Government Theories

A world government is a hypothetical entity consisting of a single or series of levels of government with authority encompassing the entire planet. No such world government has ever existed, although large empires and superpowers have attained something of that level of power; historical examples have generally been hindered by the fact that insufficient communications and travel made a world organisation of any sort, much less an entire government, unfeasible. This article will examine what proposals have been made for a world government, and which movements have advocated such a state.

Some internationalists seek the establishment of a world government as a way of establishing freedom and a benign rule of law over the world. Some (including internationalists) have concerns that a world government would need to respect the diversity of the nations or peoples it includes. Others regard a global government as a nightmarish possibility, with a malevolent world government creating an endless totalitarian state without the prospect of escape or revolution. The alternative term global political monoculture emphasizes the latter fears perceived by some to be developing via either the transnational corporations or international financial institutions, such as the International Monetary Fund the World Trade Organization and World Bank. Similarly, the term global cosmopolitan democracy describes a world government based on respect for human rights, democracy and the rule of law.

Many modern internationalists say that current shortcomings in the international order may be redressed not by merely opposing globalization, which they see as an inevitable and even welcome process, but by counterbalancing the ills brought by over-centralization or purely economic interests (such as violation of human rights - including labor rights - and sociocultural and environmental integrity) with similarly global representative democratic institutions having supranational authority.

The idea of world government is often explored in science fiction, either as a central theme or as plot backdrop.

Multinational empires, federations and unions
Effective governance of multiple nations has been accomplished in the past either by empire, by federation, or by supranational union.

Empires with pretensions or aspirations to world dominance

 * Perhaps the empire coming closest to dominance of the then-known world was Alexander's in 323 BC, an empire which sought to fuse the disparate cultures of its rapidly conquered territories rather than impose a Macedonian template.
 * "When Alexander saw the breadth of his domain, he wept for there were no more worlds to conquer." (Attributed to John Milton1 )

 * The Roman Empire (1st century BC to 5th century AD) ruled most of the Mediterranean rim, as well as parts of the Celtic regions of Northern Europe.

 * The Mongol Empire of the 13th century was probably the largest continuous land empire of all time, ruling about half of the world population. Most historians believe that Western Europe would also have fallen under Mongol rule had the news of Ögedei Khan's death not forced Batu Khan to suspend his campaign.

 * Ming Dynasty China had dominion over the "Middle Kingdom", which it believed all significant culture, science, and art in the world. On the verge of global naval dominance the Chinese fleet was recalled partially because the Emperor was thought to need nothing in the outside world. Jared Diamond has advanced the thesis that a government, such as China's, without meaningful external opposition will tend to technologically and socially stagnate; many modern objections to World Government are based on the long decline of Imperial China.

 * The Ottoman Empire which ended in 1922, covered the entire Arab world, to include the Middle East, North Africa and parts of Europe and Asia.

 * The British Empire reached its peak in early 20th century, ruling over about a quarter of Earth's population.

 * The Soviet Union ("Union of Soviet Socialist Republics" - USSR) stretched over large parts of the northern Eurasian continent from 1922 to 1991. Until 1935 it proposed a global communist government through exported revolution and military expansion.

Voluntary unions of polities in history
Countries like Switzerland and Belgium developed confederal forms of government centuries ago to bring diverse groups together to peacefully form stable and effective societies that continue to respect internal linguistic and ethnic diversity. The Netherlands established the world's first federation by creating the United Provinces in 1581 by signing of the Oath of Abjuration. The United States established the world's second federation with the replacement of the Articles of Confederation by the Federal Constitution of 1787, which has since been emulated by dozens of countries. In addition, the extent of the United States' influence both military and economically in affairs outside its borders has been described as an American Empire. India, the world's largest democracy, is a federation of dozens of peoples, each with its own culture and language.

More recently, the evolving and expanding European Union has attempted to unite a large group of widely diverse, formerly hostile, nations spread over a large geographical area. The EU's lead is being followed by the African Union, the Association of Southeast Asian Nations and the South American Community of Nations. These multinational associations are at different stages of development, but they are all growing, both in coverage and in extent of economic and political integration.

The total population currently aggregated under multi-national political governance organizations, either a full federation or an evolving regional integration process, is approximately 3 billion, about a half of humanity.

Functional international institutions
The United Nations (UN) is the primary institution coordinating human activities on a global scale. In addition to the main organs and various humanitarian programs and commissions of the UN itself, there are about 20 functional organizations affiliated with the UN's Economic and Social Council (ECOSOC), such as the World Health Organization the International Labour Organization, and International Telecommunications Union (chart). Of particular interest politically are the World Bank, the International Monetary Fund and the World Trade Organization.

The World Bank and the International Monetary Fund (IMF), were formed together in Bretton Woods, New Hampshire, United States, 1944, to foster global monetary cooperation and to fight poverty by financially assisting states in need. The World Trade Organization (WTO) sets the rules of international trade. It already has a semi-legislative body (The General Council, reaching decisions by consensus), and a judicial body (The Dispute Settlement Body).

There is also a body of international law, encompassing international treaties, customs, and globally acceptable legal principles. With the exceptions of cases brought before the ICC and ICJ (see below), the laws are interpreted by national courts. Many violations of treaty or customary law obligations are overlooked.

The International Court of Justice (ICJ) (also known as World Court) is the judiciary organ of the United Nations. It settles disputes submitted to it voluntarily by states (only), and gives advisory opinions on legal questions submitted to it by other organs of th UN, such as the General Assembly or Security Council.

A recent development towards the establishment of the rule of global law is The International Criminal Court (ICC). This is the first ever permanent, treaty based, international criminal court established to ensure that the gravest international crimes do not go unpunished. Of ninety-two countries who signed the treaty, forty-seven - including the United States - have not ratified it, citing various concerns about sovereignty and legal jurisdictions.

Theories of international integration
A number of scholars have theorized as to how a world government might come into being peacefully. Two general schools of thought on this are functional and regional integration. According to the functional school, world government would arise through all the nations of the world gradually establishing international bodies to deal with particular issues (trade, communications, health, etc.)—these bodies would slowly grow in power, and, having succeeded their parent states in terms of importance, finally be federated to form one world government. According to the regional school, the formation of a world government would be preceded by the formation of regional governments in different parts of the world, these regional governments later joining together to form one world government. As described above, both forms of integration are currently active and growing in scope.

Both these schools of thought see the peaceful establishment of a world government as a slow and gradual process, which will take decades, if not centuries. However, others argue that a world government could come about very quickly, through an agreement between all the nations of the world. Such a view was quite popular in the idealism of the post-World War II era (one famous proponent being Garry Davis but by the end of the 1950s had been revealed to be quite unrealistic, at least in the climate of the times. Although there is no reason theoretically why it could not happen, the practical rules of politics (especially in today's world) make the sudden establishment of such a body highly unlikely, and the gradual route holds much more promise. Many who see the establishment of a world government as desirable still hold out hope.

Of course, both possibilities can operate. Just as human society has evolved in progressively larger units of cohesion despite many setbacks—and while pushed forward rapidly at times by the results of occasional calamities and/or ingenuity and opportunity, many have proposed that this tendency toward stronger coordination, yet with decentralized control, is an inevitable path. The United States government, for example, did not come immediately into being (nor, its advocates would argue, at the expense of individuality). The states of the union were initially quite resistant to the idea of supplying any resources to the national government (if they supported one at all). However, certain events such as impending war with Great Britain drew its constituent elements closer to each other along another global trend, self-determination. Although self-determination may seem the opposite of unification, federalists (whether national or international) argue that it is actually a prerequisite to true unification (though empires have undoubtedly achieved some measure of standardization and unification). Once "liberated" to sufficiently govern their own affairs, states can associate with others in balanced relationships which allow mutual benefit. However, such a unification brought about by war as the United States experienced was not sufficient to weld its constituent elements firmly together. The Articles of Confederation deliberately created a weak federal government, dedicated to the independence of the states, without even the power to raise troops in wartime. Despite this, the loose coallition was able to defeat the greatest military power of its day. However, some in Congress were unsatisfied with this, and considered the central government too weak. They thought that it might not be able to respond efficiently to serious crises in future. Therefore, the "Founding Fathers" of the (federal) United States devised a system which prevented the national government being ineffectual without undue interference in the affairs of the states. However, the American Civil War shattered this equilibrium, with the federal government waging war against break-away states. It has been argued that this test of the system was due to its being tied in its own contradictions of "self-determination" regarding the issue of slavery, and that the Civil War strengthened the nation's unity. Much effort was also spent through educational avenues to inculcate a new sense of national unity amidst the people who had previously felt no special loyalty to those from other states.

Parallels have been drawn to the current state of weak world governance (through the United Nations and other related regional or international institutions) with the United States' Articles of Confederation. In the current system of the United Nations, many have argued that this present system gives too much weight to state sovereignty and too little to cohesive action. For example, any of 5 permanent members of the Security Council can veto any matter brought before it (not only security matters). The World Parliament (the General Assembly), it is argued, hardly represents the people, since it is not elected by the people in a separate election for international governance (and in many cases, the governments currently choosing the representatives are unelected themselves). Furthermore, the representation is not proportional in any manner to population (unlike most bicameral legislatures, including the United States House of Representatives), and their decisions are not in any way binding (besides expressing opinion). Moreover, the participating nations admitted into the United Nations General Assembly are in many cases oppressive dictatorships not accountable to their own people (perhaps parallel to the southern states of the U.S. before the Civil War not allowing black people basic economic or political freedoms such as the right to vote). The World Court, likewise, is severely limited in its powers in being able to adjudicate in matters not agreed to be brought before it by both parties, or if the parties are not states. Even those belonging to permanent member countries have argued that such sovereignty only begets anarchy in getting things accomplished (especially during the Cold War). While federalists are equally wary of the dangers of over-centralization, they argue that many aspects of the United Nations system (or a new system) should be sufficiently strengthened to allow effective action, whether dealing with security or auxiliary issues argued to be related to security.

(Besides federalism, some internationalists point to the model of a commonwealth for the future patterning of a world government which can offer another type of balance between national and international control.)

Hopes and fears
The forces of globalization have caused major changes in the type of threats and opportunities facing humanity. In many ways the world already operates as a single society, where everyone’s activities affect everyone else. Environmental damage that crosses international borders, nuclear weapons proliferation, terrorism, unchecked national militarism, international crime, cruel regimes, anarchic states and refugees are all examples of issues that cannot be fully addressed by individual national governments, or even by voluntary multilateral treaties and agreements. While some military spending contributes to prosperity, advocates of world government hope that non-military means of providing security will be more economical and free up resources that can stimulate prosperity directly and more efficiently. They hope that a worldwide democratic electorate would reassign military budgets to stimulate economic growth in poor countries, e.g., by improving education and productivity-amplifying infrastructure, and the global maintenance of the rule of law. The local populations, however, may prefer to reallocate military budgets to lowering taxes or increasing local social welfare spending instead.

Beyond the humane benefits, advocates claim such reallocation would eliminate, once and for all, inter-governmental threats, including a large-scale nuclear holocaust (World War III). At the end of the second world war, nationalists and internationalists alike found this to be a compelling motive for the formation of world government:

 * "Unless we establish some form of world government, it will not be possible for us to avert a World War III in the future." (Winston Churchill, 1945).

 * "As long as there are sovereign nations possessing great power, war is inevitable. There is no salvation for civilization, or even the human race, other than the creation of a world government." (Albert Einstein, Letter to World Federalists, Stockholm Congress, 1949)

While acknowledging that a world government may be wasteful and inefficient, proponents contend that the costs of not having such a government are far higher. Conversely, they claim that the currently fragmented and loosely coordinated system of international governance misses countless opportunities for beneficial collaboration across national boundaries. To quote H.G. Wells (The Outline of History, 1922): "There can be little question that the attainment of a federation of all humanity, together with a sufficient measure of social justice, to ensure health, education, and a rough measure of equality of opportunity to most of the children born into the world, would mean such a release and increase of human energy as to open a new phase in human history."

From the above observations, advocates of world government hope that enlightened self-interest at the national level would naturally lead to the rise of a world government, without the common external threats that led states and provinces to federate into countries in previous centuries. In the short term, however, many hurdles remain to be overcome.

National governments in positions of greater military or economic power enjoy greater freedom to pursue their agendas with lower concern for the reaction of governments of less powerful nations. Accepting the supremacy of global law requires such governments to accept additional constraints on the range of available actions they may take, and to comply with decisions of courts over which they have limited control. Even when support of a global authority is of clear benefit to the majority of citizens of a country, such support may still act against the desire of individual government members for greater personal influence. This unfortunate conflict of interests is much amplified in despotic regimes, reducing the likelihood that a democratic federal government with global jurisdiction can be established prior to the complete elimination of dictatorial governments at the national level.

There are also hurdles to expanding popular support for the idea. People in many countries feel intense loyalty to their nation-state and/or legally protected rights, resulting in reluctance to accept arrangements in which national sovereignty is compromised. In Western systems which place high value on individual autonomy, discussions of a global government sometimes invoke frightening visions of absolute collective or dictatorial control from which there is no escape. Others are concerned that proper controls over a remote world government would be difficult to implement, leading to excessive waste, corruption and abuse of power. To quote former U.S. Senator Barry Goldwater: "A government that is big enough to give you all you want is big enough to take it all away." On the other hand, some people in non-Western countries under the hegemony of their cultures and ruling oligarchies, demonize the anarchy of individuality and are suspicious of world government for fears that Western powers will unduly impose their values through control of these institutions.

Some religious teachings, such as those of the Bahá'í Faith and Unitarian Universalism, are highly supportive of a world government. At the other extreme, numerous fundamentalist Christians in the U.S. associate the idea of world government (and, indeed, powerful international organizations in general) with the Antichrist and the End Times. (See, for example, Pat Robertson's book The New World Order.)

Despite the slow progress, many advocates remain hopeful that ingenuity, education, statesmanship, and other proactive efforts would continue to advance support among nations and their leaders for a greater political and social union based on justice, consultation, and respect for state and individual rights. The desire of countries bordering the European Union to join it, in effect creating a voluntarily expanding democratic empire, demonstrates the attraction of a multi-national political and economical integration. (However, the apparent reluctance of many within the union to allow rapid expansion may be a countervailing indicator). Nations in Africa (AU), South America (SACN) and South-East Asia (ASEAN) have launched similar political integration efforts. Activist organizations, such as the World Federalist Movement, continue to promote the idea of a global federal democracy amongst national governments, and are constantly seeking to expand their membership.

The United Nations as a budding federal world government
The United Nations currently mainly serves as a forum for the world's sovereign states to debate issues and determine collective courses of action. As such, it is not set up to easily evolve into a federal world government. Its most critical deficiencies are (1) legitimacy and (2) power.

Legitimacy is lacking in that the operation of the UN is not based on widely accepted democratic principles, such as proportional representation (each government has one vote regardless of population size, or whether it truly represents that population) or equality of status (some countries have permanent seats and veto power in the security council). Some proposals for improving the UN's legitimacy involve the introduction of weighted voting, the establishment of a directly-elected parliamentary organ, or the creation of an additional body (internal or external) open only to self-styled democracies.

Power is lacking in that implementation of its decisions is entirely dependent on the goodwill of its members. It has no legal power to directly collect taxes to fund operations, maintain an army or a police force, or directly impose economical penalties on national governments refusing to comply with its decisions. Proposals for increasing the UN's power include the direct collection of taxes, for instance: An independent income would permit the UN to establish its own standing rapid-deployment military and police forces.
 * Taxing international monetary transactions (the "Tobin Tax")
 * Licensing the use of global commons (oceans, space)

A proposal called the binding triad would make General Assembly resolutions binding if approved by a group of nations representing a majority of
 * The world's population;
 * UN financial contributions; and
 * The membership of the General Assembly.

One the most significant current hurdle to the growth in UN influence is the reluctance of the current US administration to concede autonomy, especially following the refusal of the Security Council to approve a military attack on Iraq in early 2003 and the subsequent declaration of this attack as illegal by the UN's Secretary General. Some hope that the reluctance of the US government to support further UN growth would be overcome by reform, openness and accountability in the UN, and demonstrated integrity and transparency in the administration of international law. Others believe that a refusal by other nations to collaborate with the US other than via the UN (or other rule-governed institutions) would be necessary.

Attributed ideologies
Various people attribute, though not at times without caricature, the idea of a world government to, often exclusively, and often with false assumptions, ideologies (frequently extreme) such as :

Nazism
Adolf Hitler attempted to establish a "thousand year Reich" that, at the very least, would have encompassed Europe and Russia. It seems probable that had Hitler been successful in this, he would have eventually attempted to conquer the rest of the world. However, he believed that a state was at its strongest when at war, so perpetual or recurring war would probably have been something he would advocate; thus negating the possibility of a complete world government.

Neoliberalism
Neoliberals rarely advocate a world government in the classical sense of the word, and prefer instead a single world-wide economic order of free market capitalism. Their aim would be the eventual integration of all countries into this economic order, with the removal of all trade barriers and (in some cases) the removal of all regulations on capitalism. Strands of neoliberal thought influence the International Monetary Fund and the World Bank, which are the focus of opposition from the anti-globalization movement.

Communism
The communist movement has an ideal of world government emerging from the voluntary co-operation of communist countries, presumably after capitalism has been overthrown. However, in the past, many communist states showed distrust or even outright hostility towards each other (see the Sino-Soviet split between the Soviet Union and the People's Republic of China).

In particular, Leon Trotsky is famous—and probably foremost among communists—in advocating a "world revolution," as opposed to the single-state visions of Stalin and Mao. His supporters have suffered alienation within the communist movement, however, due in large part to the propaganda of the Soviet Union against Trotsky. They have been making a comeback only since the fall of the Soviet Union.

Anarchism
Although anarchists advocate a world not divided by borders, which they regard as nothing but artificial boundaries, and are generally against nationalism, they do not advocate a world government as such, because government itself is an institution they believe to be morally wrong and harmful. Instead, anarchists propose a world order based on free association and mutual aid, though this may vary depending on the specific branch of anarchism in question (see the main article on anarchism for further details).

Conspiracy theory
A number of conspiracy theories postulate the existence of a mysterious global cabal that controls the world, or large portions of it, from behind the scenes. Other theories prophecise (or warn of) domination of the world by a single entity, often referred to as a "One World Government".

A large, loving family
When children are young, their basic needs (food, shelter and clothing) are provided, and it should be possible to create in time a world government that will abolish all poverty-related hardships, possibly combined with a limitation of populations to areas where there is, and will be, enough for all. It may also involve other limitations, such as a guidance of students into careers where there will be certain to be a job for them when they are ready for a job. Probably there have already been (unsuccessful?) attempts to build such a society on a small scale.

A society based on systems in a healthy human body
The human body includes many highly successful systems that together do their best to keep the body working, and even working well, such as the food processing, the garbage/rubbish expulsion, the regulation of body temperature, the defences against various bacteria and virus infections. etc. The various organs do their work reliably and without strikes, slowdowns, etc. and they work for the well-being of the whole body, not just for individual selfish aims. Possibly there have already been (unsuccessful?) attempts to build such a society on a small scale.

World government in science fiction
In both science fiction and utopian/dystopian novels, authors have made frequent use of the age-old idea of a global state and, accordingly, of world government. In tune with Immanuel Kant|Kant's vision of a world state based on the voluntary union of all countries of this planet in order to avoid colonialism and in particular any future war ("Idee zu einer allgemeinen Geschichte in weltbürgerlicher Absicht", 1784; "Zum ewigen Frieden", 1795), some of these scenarios depict an egalitarian and environmentally sustainable world supervised (rather than controlled) by a benevolent (and usually democratic) world government. Others, however, describe the effects of a totalitarian regime which, after having seized power in one country, annexes the rest of the world in order to dominate and oppress all humankind. James L. Halperin's novel The Truth Machine (1996) is an example of the former while Ira Levin's This Perfect Day (1970) and the evangelical Christian Left Behind series are examples of the latter.

The Truth Machine envisages the future of humankind after the invention of a device which is much more reliable than conventional lie detectors. Mass marketed and as small and cheap as a mobile phone, the truth machine is available to everyone so that lying has become something which just does not pay any longer and, consequently, is generally considered erratic behaviour which used to occur in the past. Also, crime has become almost obsolete. As politicians are in no way exempt from being continually checked, no economy with the truth can be found in their speeches or soundbites any longer, and only those who really wish well are prepared to take office. As the only remaining superpower, the United States of America takes the lead and all the other nations readily join in to form a truly global society.

The Left Behind books are a series of novels that tell the story of the Rapture according to evangelical Christian theology. The stories center around the quick rise to power of a charismatic, populist Romanian politician named Nicholae who is eventually appointed Secretary General of the United Nations. Once in power, Nicholae advocates a series of popular proposals, such as a global currency and massive international disarmament. Eventually, all countries unite into one "Global Community." However, things quickly turn sinister, and although Nicholae remains increasingly revered (now as "Global Pontiff") he institutes increasingly totalitarian measures to unite the world, such as allowing only one legal religion, and only one global media outlet. Nicholae is eventually seen as the antichrist, and is rejected by the books' Christian protagonists. The idea that the antichrist will be the leader and chief advocate of a world government is a popular theory among believers in Christian Rapture theory.

This Perfect Day is set in a seemingly perfect global society whose genesis remains vague ("Christ, Marx, Wood and Wei led us to this perfect day" is what schoolchildren have to chant). The world is ruled by a central computer called UniComp which has been programmed to keep every single human on the surface of the earth in check. People are continually drugged by means of regular injections so that they can never realize their potential as human beings. They are told where to live, what to eat and which job to take. Everyone wears a bracelet with a scanner which tells them where they are allowed to go and what they are allowed to do. At 65, they receive a lethal injection. Even opposition against such a life by those few who happen to be resistant to the drug and who consequently wake up to a day which for them turns out to be anything but perfect is dealt with by the programmers of UniComp who, in their underground hideaway, constitute the world government.

Lunar government
Perhaps the most promising prospect in the near future for a single world government may be on the moon. Administration of Lunar territories may initially follow the Antarctic model, whereby land is divided up amongst existing nations. Once a sufficient population has developed, several thousand perhaps, a path towards self-governance could be forged through either the UN or by a unilateral declaration of independence. (This would be a “world government” in the sense of unitary planetary authority but would lead to the balkanization of the solar system, and would actually create more, rather than fewer sovereign governments.)