---------------------------------------------------------------------------- DESCRIPTION ---------------------------------------------------------------------------- Nifty PHP Utilities Version 2.00 (September 16, 2002) by Ying Zhang ---------------------------------------------------------------------------- LATEST VERSION ---------------------------------------------------------------------------- You can always obtain the latest version of Nifty PHP Utilities from the homepage at: http://dcfonline.sfu.ca/ying/phputils You may also find extra documentation and instructions there that are not included in this file, so check every now and then to make sure you have the latest and greatest version. ---------------------------------------------------------------------------- REQUIREMENTS ---------------------------------------------------------------------------- You need the binary version of PHP4, compiled with readline support. I am using PHP 4.2.3 and developed phputils on Linux and Win32. Most of the tools in this package should work with any platform where you can run PHP4. Although the bandwidth monitor is probably Linux specific because it reads from /proc/net/dev. Also, things like rpmupdate probably won't do you any good unless you use Redhat :) Instructions on building a PHP4 binary (CGI) are available at the PHP homepage (http://www.php.net). Here is a quick summary of how I built my PHP binary: ./configure \ --disable-debug \ --with-config-file-path=/usr/local/etc \ --with-readline \ --enable-inline-optimization make make install That should put create /usr/local/bin/php among other things, now type php -v (assuming /usr/local/bin is in your path) and if all goes well it should show you the PHP version number. ---------------------------------------------------------------------------- INSTALLATION ---------------------------------------------------------------------------- Simply extract the files from the phputils archive, you may have to edit the first line in each file if your PHP binary is not in /usr/local/bin. What follows is some specific configuration that you might need: bandwidth - Change the value for SLEEPSEC to alter how many seconds to wait between each update. The default is 1 second. - Add the name of the interfaces you want to ignore in the array $ignore_if. dirsync - no configuration needed isalive - Add to the recipients array the people who you want to email when the status of a host changes (ie. when it goes up/down) - Add more addserver() calls to add servers that you want to monitor. - Uncomment the email() calls if you want to get email notification when the status of a server goes up and down. nicenames - no configuration needed rpmupdates - Change $rpmdir to the directory where your newly downloaded RPM files reside ---------------------------------------------------------------------------- RUNNING ---------------------------------------------------------------------------- bandwidth Just run it by typing ./bandwidth (or just bandwidth if it's in your path somewhere) and it will spit out a running listings of the bandwidth going through your network interfaces. dirsync Run dirsync by typing ./dirsync [master] [slave] where [master] is the directory you want to copy to [slave]. If you don't want extra files in [slave] that aren't in [master] to be removed, run it like so: ./dirsync [master] [slave] x isalive You probably want to run this as in the background, so once you verify it's working (run ./isalive, disconnect and reconnect your network cable, see if it logs anything) you can do something like this: nohup isalive >> ~/isalive.log nicenames You can run in Interactive mode, where you enter in filenames and it will display a nicely formatted one. Or run it in automatic mode and it will rename all the files in the directory (of course you will get to confirm you want to actually do it). rpmupdates Just run it and it will look in $rpmdir to find all RPMs that are newer than what you've got installed. ---------------------------------------------------------------------------- TODO (in no particular order) ---------------------------------------------------------------------------- * Better Documentation As you can tell, this INSTALL file is very sparse and assumes you know a lot about PHP. In the future I would like to find some time to make better documentation to explain things in more detail. * Configuration Files Instead of modifying the source code directly, customizations should go into configuration files. END OF FILE