1#!/bin/sh 2 3renameandlink() 4{ 5 if test -f $1 6 then 7 mv $1 $2 8 ln -s $2 $1 9 fi 10} 11 12if test "$BBHOME" = "" 13then 14 echo "ERROR: This must be invoked using the bbcmd utility" 15 echo " bbcmd $0" 16 exit 1 17fi 18 19# Get directory where we are running from 20SDIR=`dirname $0` # Could be a relative path 21SDIRFULL=`(cd $SDIR; pwd)` 22 23if test ! -f $SDIRFULL/renamevars 24then 25 echo "ERROR: You must run 'make' first to build the 4.3.0 tools" 26 exit 1 27fi 28 29cd $BBHOME/etc || (echo "Cannot cd to etc directory"; exit 1) 30if test ! -w .; then echo "Cannot write to etc directory"; exit 1; fi 31renameandlink bb-hosts hosts.cfg 32renameandlink bbcombotest.cfg combo.cfg 33renameandlink hobbit-alerts.cfg alerts.cfg 34renameandlink hobbit-nkview.cfg critical.cfg 35renameandlink hobbit-nkview.cfg.bak critical.cfg.bak 36renameandlink hobbit-rrddefinitions.cfg rrddefinitions.cfg 37renameandlink hobbitgraph.cfg graphs.cfg 38renameandlink hobbit-holidays.cfg holidays.cfg 39renameandlink hobbit-clients.cfg analysis.cfg 40renameandlink hobbit-snmpmibs.cfg snmpmibs.cfg 41renameandlink hobbit-apache.conf xymon-apache.conf 42renameandlink bb-services protocols.cfg 43renameandlink hobbitcgi.cfg cgioptions.cfg 44 45if test -f hobbitlaunch.cfg 46then 47 mv hobbitlaunch.cfg tasks.old 48 $SDIRFULL/renametasks <tasks.old >tasks.cfg 49 ln -s tasks.cfg hobbitlaunch.cfg 50fi 51 52if test -f hobbitserver.cfg 53then 54 mv hobbitserver.cfg xymonserver.old 55 $SDIRFULL/renamevars >xymonserver.cfg <<EOF1 56XYMONACKDIR=BBACKS 57XYMONALLHISTLOG=BBALLHISTLOG 58XYMONDATADIR=BBDATA 59XYMONDATEFORMAT=BBDATEFORMAT 60XYMONDISABLEDDIR=BBDISABLED 61XYMSERVERS=BBDISPLAYS 62XYMON=BB 63XYMSRV=BBDISP 64XYMONGENOPTS=BBGENOPTS 65XYMONGENREPOPTS=BBGENREPOPTS 66XYMONGENSNAPOPTS=BBGENSNAPOPTS 67XYMONHELPSKIN=BBHELPSKIN 68XYMONHISTEXT=BBHISTEXT 69XYMONHISTLOGS=BBHISTLOGS 70XYMONHISTDIR=BBHIST 71XYMONHOME=BBHOME 72XYMONHOSTHISTLOG=BBHOSTHISTLOG 73HOSTSCFG=BBHOSTS 74XYMONHTMLSTATUSDIR=BBHTML 75XYMONLOGSTATUS=BBLOGSTATUS 76XYMONRAWSTATUSDIR=BBLOGS 77MAXMSGSPERCOMBO=BBMAXMSGSPERCOMBO 78XYMONMENUSKIN=BBMENUSKIN 79XYMONNOTESSKIN=BBNOTESSKIN 80XYMONNOTESDIR=BBNOTES 81SERVEROSTYPE=BBOSTYPE 82XYMONREPEXT=BBREPEXT 83XYMONREPGREEN=BBREPGREEN 84XYMONREPURL=BBREPURL 85XYMONREPWARN=BBREPWARN 86XYMONREPDIR=BBREP 87XYMONROUTERTEXT=BBROUTERTEXT 88XYMONRRDS=BBRRDS 89XYMONRSSTITLE=BBRSSTITLE 90XYMONSERVERCGIURL=BBSERVERCGIURL 91XYMONSERVERHOSTNAME=BBSERVERHOSTNAME 92XYMONSERVERIP=BBSERVERIP 93XYMONSERVERLOGS=BBSERVERLOGS 94XYMONSERVEROS=BBSERVEROS 95XYMONSERVERROOT=BBSERVERROOT 96XYMONSERVERSECURECGIURL=BBSERVERSECURECGIURL 97XYMONSERVERWWWNAME=BBSERVERWWWNAME 98XYMONSERVERWWWURL=BBSERVERWWWURL 99XYMONSKIN=BBSKIN 100SLEEPBETWEENMSGS=BBSLEEPBETWEENMSGS 101XYMONSNAPURL=BBSNAPURL 102XYMONSNAPDIR=BBSNAP 103XYMONTMP=BBTMP 104XYMONVAR=BBVAR 105XYMONWAP=BBWAP 106XYMONWEBHOSTURL=BBWEBHOSTURL 107XYMONWEBHOST=BBWEBHOST 108XYMONWEBHTMLLOGS=BBWEBHTMLLOGS 109XYMONWEB=BBWEB 110XYMONWWWDIR=BBWWW 111XYMONPAGEACKFONT=MKBBACKFONT 112XYMONPAGECOLFONT=MKBBCOLFONT 113XYMONPAGELOCAL=MKBBLOCAL 114XYMONPAGEREMOTE=MKBBREMOTE 115XYMONPAGEROWFONT=MKBBROWFONT 116XYMONPAGESUBLOCAL=MKBBSUBLOCAL 117XYMONPAGETITLE=MKBBTITLE 118EOF1 119 ln -s xymonserver.cfg hobbitserver.cfg 120fi 121 122cd $BBHOME || (echo "Cannot cd to BBHOME directory"; exit 1) 123if test ! -w .; then echo "Cannot write to BBHOME directory"; exit 1; fi 124renameandlink hobbit.sh xymon.sh 125 126 127cd $BBHOME/bin || (echo "Cannot cd to bin directory"; exit 1) 128if test ! -w .; then echo "Cannot write to bin directory"; exit 1; fi 129renameandlink hobbit.sh xymon.sh 130renameandlink bb xymon 131renameandlink bbgen xymongen 132renameandlink bbcmd xymoncmd 133renameandlink bbhostgrep xymongrep 134renameandlink bbhostshow xymoncfg 135renameandlink hobbitlaunch xymonlaunch 136renameandlink bbdigest xymondigest 137renameandlink hobbitd xymond 138renameandlink hobbitd_alert xymond_alert 139renameandlink hobbitd_capture xymond_capture 140renameandlink hobbitd_channel xymond_channel 141renameandlink hobbitd_client xymond_client 142renameandlink hobbitd_filestore xymond_filestore 143renameandlink hobbitd_history xymond_history 144renameandlink hobbitd_hostdata xymond_hostdata 145renameandlink hobbitd_locator xymond_locator 146renameandlink hobbitd_rrd xymond_rrd 147renameandlink hobbitd_sample xymond_sample 148renameandlink hobbitfetch xymonfetch 149renameandlink hobbit-mailack xymon-mailack 150renameandlink bbcombotest combostatus 151renameandlink bbtest-net xymonnet 152renameandlink bbretest-net.sh xymonnet-again.sh 153renameandlink hobbitping xymonping 154renameandlink hobbit-snmpcollect xymon-snmpcollect 155renameandlink bbproxy xymonproxy 156renameandlink bb-ack.cgi ack.cgi 157renameandlink bb-csvinfo.cgi csvinfo.cgi 158renameandlink bb-datepage.cgi datepage.cgi 159renameandlink bb-eventlog.cgi eventlog.cgi 160renameandlink bb-findhost.cgi findhost.cgi 161renameandlink bb-hist.cgi history.cgi 162renameandlink bb-histlog.cgi historylog.cgi 163renameandlink bb-hostsvc.sh svcstatus.sh 164renameandlink bb-message.cgi xymoncgimsg.cgi 165renameandlink bb-rep.cgi report.cgi 166renameandlink bb-replog.cgi reportlog.cgi 167renameandlink bb-snapshot.cgi snapshot.cgi 168renameandlink bb-webpage xymonpage 169renameandlink hobbit-ackinfo.cgi ackinfo.cgi 170renameandlink hobbit-certreport.sh certreport.sh 171renameandlink hobbit-confreport.cgi confreport.cgi 172renameandlink hobbit-enadis.cgi enadis.cgi 173renameandlink hobbit-ghosts.cgi ghostlist.cgi 174renameandlink hobbit-hostgraphs.cgi hostgraphs.cgi 175renameandlink hobbit-hostlist.cgi hostlist.cgi 176renameandlink hobbit-nkedit.cgi criticaleditor.cgi 177renameandlink hobbit-nkview.cgi criticalview.cgi 178renameandlink hobbit-nongreen.sh nongreen.sh 179renameandlink hobbit-notifylog.cgi notifications.cgi 180renameandlink hobbit-perfdata.cgi perfdata.cgi 181renameandlink hobbit-statusreport.cgi statusreport.cgi 182renameandlink hobbit-topchanges.sh topchanges.sh 183renameandlink hobbit-useradm.cgi useradm.cgi 184renameandlink hobbitcolumn.sh columndoc.sh 185renameandlink hobbitgraph.cgi showgraph.cgi 186renameandlink hobbitsvc.cgi svcstatus.cgi 187renameandlink hobbitreports.sh xymonreports.sh 188 189cd $BBHOME/web || (echo "Cannot cd to web-templates directory"; exit 1) 190if test ! -w .; then echo "Cannot write to web-templates directory"; exit 1; fi 191renameandlink bb_header stdnormal_header 192renameandlink bb_footer stdnormal_footer 193renameandlink bb2_header stdnongreen_header 194renameandlink bb2_footer stdnongreen_footer 195renameandlink bbnk_header stdcritical_header 196renameandlink bbnk_footer stdcritical_footer 197renameandlink bbsnap_header snapnormal_header 198renameandlink bbsnap_footer snapnormal_footer 199renameandlink bbsnap2_header snapnongreen_header 200renameandlink bbsnap2_footer snapnongreen_footer 201renameandlink bbsnapnk_header snapcritical_header 202renameandlink bbsnapnk_footer snapcritical_footer 203renameandlink bbrep_header repnormal_header 204renameandlink bbrep_footer repnormal_footer 205renameandlink hobbitnk_header critical_header 206renameandlink hobbitnk_footer critical_footer 207renameandlink nkack_header critack_header 208renameandlink nkack_form critack_form 209renameandlink nkack_footer critack_footer 210renameandlink nkedit_header critedit_header 211renameandlink nkedit_form critedit_form 212renameandlink nkedit_footer critedit_footer 213 214cd $BBHOME/ext || (echo "Cannot cd to ext directory"; exit 1) 215if test ! -w .; then echo "Cannot write to ext directory"; exit 1; fi 216renameandlink bbretest-net.sh xymonnet-again.sh 217 218 219cd $BBSERVERROOT/cgi-bin || (echo "Cannot cd to cgi-bin directory"; exit 1) 220if test ! -w .; then echo "Cannot write to cgi-bin directory"; exit 1; fi 221renameandlink bb-hist.sh history.sh 222renameandlink bb-eventlog.sh eventlog.sh 223renameandlink bb-rep.sh report.sh 224renameandlink bb-replog.sh reportlog.sh 225renameandlink bb-snapshot.sh snapshot.sh 226renameandlink bb-findhost.sh findhost.sh 227renameandlink bb-csvinfo.sh csvinfo.sh 228renameandlink hobbitcolumn.sh columndoc.sh 229renameandlink bb-datepage.sh datepage.sh 230renameandlink hobbitgraph.sh showgraph.sh 231renameandlink bb-hostsvc.sh svcstatus.sh 232renameandlink bb-histlog.sh historylog.sh 233renameandlink hobbit-confreport.sh confreport.sh 234renameandlink hobbit-confreport-critical.sh confreport-critical.sh 235renameandlink hobbit-nkview.sh criticalview.sh 236renameandlink hobbit-certreport.sh certreport.sh 237renameandlink hobbit-nongreen.sh nongreen.sh 238renameandlink hobbit-hostgraphs.sh hostgraphs.sh 239renameandlink hobbit-ghosts.sh ghostlist.sh 240renameandlink hobbit-notifylog.sh notifications.sh 241renameandlink hobbit-hostlist.sh hostlist.sh 242renameandlink hobbit-perfdata.sh perfdata.sh 243renameandlink hobbit-topchanges.sh topchanges.sh 244 245cd $BBSERVERROOT/cgi-secure || (echo "Cannot cd to cgi-secure directory"; exit 1) 246if test ! -w .; then echo "Cannot write to cgi-secure directory"; exit 1; fi 247renameandlink bb-ack.sh acknowledge.sh 248renameandlink hobbit-enadis.sh enadis.sh 249renameandlink hobbit-nkedit.sh criticaleditor.sh 250renameandlink hobbit-ackinfo.sh ackinfo.sh 251renameandlink hobbit-useradm.sh useradm.sh 252 253 254cd $BBSERVERROOT/client/etc || (echo "Cannot cd to client/etc directory"; exit 1) 255if test ! -w .; then echo "Cannot write to client/etc directory"; exit 1; fi 256if test -f hobbitclient.cfg 257then 258 mv hobbitclient.cfg xymonclient.old 259 $SDIRFULL/renamevars >xymonclient.cfg <<EOF2 260XYMSRV=BBDISP 261XYMSERVERS=BBDISPLAYS 262XYMONDPORT=BBPORT 263XYMONHOME=HOBBITCLIENTHOME 264XYMON=BB 265XYMONTMP=BBTMP 266XYMONCLIENTLOGS=BBCLIENTLOGS 267EOF2 268 ln -s xymonclient.cfg hobbitclient.cfg 269fi 270 271cd $BBSERVERROOT/client/bin || (echo "Cannot cd to client/bin directory"; exit 1) 272if test ! -w .; then echo "Cannot write to client/bin directory"; exit 1; fi 273renameandlink bb xymon 274renameandlink bbcmd xymoncmd 275renameandlink bbdigest xymondigest 276renameandlink bbhostgrep xymongrep 277renameandlink bbhostshow xymoncfg 278renameandlink hobbitclient-aix.sh xymonclient-aix.sh 279renameandlink hobbitclient-darwin.sh xymonclient-darwin.sh 280renameandlink hobbitclient-freebsd.sh xymonclient-freebsd.sh 281renameandlink hobbitclient-hp-ux.sh xymonclient-hp-ux.sh 282renameandlink hobbitclient-irix.sh xymonclient-irix.sh 283renameandlink hobbitclient-linux.sh xymonclient-linux.sh 284renameandlink hobbitclient-netbsd.sh xymonclient-netbsd.sh 285renameandlink hobbitclient-openbsd.sh xymonclient-openbsd.sh 286renameandlink hobbitclient-osf1.sh xymonclient-osf1.sh 287renameandlink hobbitclient-sco_sv.sh xymonclient-sco_sv.sh 288renameandlink hobbitclient.sh xymonclient.sh 289renameandlink hobbitclient-sunos.sh xymonclient-sunos.sh 290renameandlink hobbitlaunch xymonlaunch 291renameandlink orcahobbit orcaxymon 292 293 294cd $BBRRDS/$MACHINEDOTS || (echo "Cannot cd to Xymon-servers\' RRD directory"; exit 1) 295if test ! -w .; then echo "Cannot write to Xymon-servers\' RRD directory"; exit 1; fi 296if test -f hobbitd.rrd; then mv hobbitd.rrd xymond.rrd; fi 297if test -f bbgen.rrd; then mv bbgen.rrd xymongen.rrd; fi 298if test -f bbtest.rrd; then mv bbtest.rrd xymonnet.rrd; fi 299if test -f bbproxy.rrd; then mv bbproxy.rrd xymonproxy.rrd; fi 300 301cd $BBHIST || (echo "Cannot cd to Xymon-servers\' history directory"; exit 1) 302if test ! -w .; then echo "Cannot write to Xymon-servers\' history directory"; exit 1; fi 303if test -f $MACHINE.bbgen; then mv $MACHINE.bbgen $MACHINE.xymongen; fi 304if test -f $MACHINE.bbtest; then mv $MACHINE.bbtest $MACHINE.xymonnet; fi 305if test -f $MACHINE.hobbitd; then mv $MACHINE.hobbitd $MACHINE.xymond; fi 306if test -f $MACHINE.bbproxy; then mv $MACHINE.bbproxy $MACHINE.xymonproxy; fi 307 308MACHINEUS=`echo $MACHINE | sed -e 's!,!_!g'` 309cd $BBHISTLOGS/$MACHINEUS || (echo "Cannot cd to Xymon-servers\' histlogs directory"; exit 1) 310if test ! -w .; then echo "Cannot write to Xymon-servers\' histlogs directory"; exit 1; fi 311if test -d bbgen; then mv bbgen xymongen; fi 312if test -d bbtest; then mv bbtest xymonnet; fi 313if test -d hobbitd; then mv hobbitd xymond; fi 314if test -d bbproxy; then mv bbproxy xymonproxy; fi 315 316cd $BBWWW || (echo "Cannot cd to Xymon-servers\' www directory"; exit 1) 317if test ! -w .; then echo "Cannot write to Xymon-servers\' www directory"; exit 1; fi 318renameandlink bb.html xymon.html 319renameandlink bb2.html nongreen.html 320renameandlink bbnk.html critical.html 321 322 323echo "" 324echo "Things you must do" 325echo "==================" 326echo "" 327echo "* Run 'make install' now to install Xymon 4.3.0." 328echo "" 329echo "* If you have modified web templates files, then these have" 330echo " NOT been updated with the new default templates. You must" 331echo " manually install the new templates from the xymond/webfiles" 332echo " directory, and copy over any changes you have made locally." 333echo " All of the template files were updated to include a link" 334echo " to the new xymon.sourceforge.net website, the DOCTYPE header" 335echo " was updated from '4.0 Transitional' to '4.0', the Java" 336echo " menu-code in the footer-files was replaced with &XYMONBODYFOOTER" 337echo " the menu stylesheet was changed to &XYMONBODYMENUCSS, and a line" 338echo " with &XYMONBODYHEADER was added just after the BODY tag in all" 339echo " header-files." 340echo " The following files had further changes from 4.2.3 to 4.3.0:" 341echo " - event_form" 342echo " - hostgraphs_form" 343echo " - notify_form" 344echo " If you modified these three files, it is probably best to" 345echo " copy the new standard files from xymond/webfiles/ to your" 346echo " $BBHOME/web/ and re-add your local changes." 347echo "" 348echo "* If you have modified the menu-entries in the Xymon menu, then" 349echo " these changes have not been ported over to the new setup. You" 350echo " must add these changes to the new $BBHOME/etc/xymonmenu.cfg file." 351echo "" 352echo "* In your Apache (webserver) configuration, add" 353echo " FollowSymLinks to the Options line for the" 354echo " $BBSERVERROOT/cgi-bin and $BBSERVERROOT/cgi-secure directories." 355echo "" 356echo "* Also in your Apache (webserver) configuration, add" 357echo " Rewrite-rules so the old URL's for CGI-scripts and webpages" 358echo " still work. See the xymond/etcfiles/xymon-apache.conf example file." 359echo "" 360 361exit 0 362 363