update ppweb-monitor-daemon.py

* daemonize after startup
* start therads for every conf file found, thread should stop when
  conf file varnishes
* the main thread will look for new conf file and create check thread
* when using Popen, don't set stdout/stderr to PIPE, or it may block
  (or say deadlock) the thread, write to a temp shm file instead
add readme file
修改使其正常现实代码
test show codes
test show codes
test show codes
[daemon] add restart logic

* fix path issue, when script is invoked as relative path, __file__
  is also relative path, we should use os.path.abspath()
* dump pid after daemonize(), on start up, try kill previous instance
  first. so we don't need any `start.sh`.
* create log dir and ignore it.
ignore bin/ and conf/. most of files should be distributed with salt
[client] add gather_results.py

this script is called by check_nrpe and run on the client, it gather
all check results into a single json, and compress to send back to
nagios server.

the output is first zlib.compress()-ed, and then base64.encodestring()-ed,
see comments in gather_results.py for the reason.

on command line, use the following command to examine the output:
client/gather_results.py \
        base64 -d \
        python -c 'import zlib, sys; print zlib.decompress(sys.stdin.read())' \
        python -m simplejson.tool
reorganize dir structure

files needed by client:
client/
  - check-daemon.py   -- daemon that runs check scripts periodically
  - gather-results.py -- script to gather status files, invoked by check_nrpe
conf/                 -- check confs provided by apps
bin/                  -- check binary provided by apps
status/               -- check-daemon will put check results here

files needed by server:
server/
  - check-client.py   -- script that will ask client for status and
                         perform alerts
  - mailclient.py     -- mail client lib
  - smsclient.py      -- sms client lib
  - cache/            -- server side cache of status
rename pyfiles, use hyphen(-) instead of underscore(_) in filenames
rename old check-client.py
Merge branch 'master' of git.corp.ppweb.com.cn:ops/monitor
[bin] fix syntax issue with check_load and division by zero with check_swap
add server/check-client.py
fix alert_global_error()