branch develop updated (515d017 -> df5ffd6)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository mum. See http://git.chorem.org/mum.git from 515d017 app.py renommé en mum.py + le fichier de conf doit être passé en argument par ligne de commande + un argument en ligne de commande peut surcharger un champ du fichier de conf new df5ffd6 fichier de conf ajouté de nouveau à git. il est nécessaire de faire une copie locale de ce fichier avant de le modifier => README mis à jour ainsi que script install.sh + paramètres du service ajoutés au fichier de conf The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit df5ffd6cb31fa95bec754d9115ece4860e24aa81 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 27 17:28:56 2015 +0100 fichier de conf ajouté de nouveau à git. il est nécessaire de faire une copie locale de ce fichier avant de le modifier => README mis à jour ainsi que script install.sh + paramètres du service ajoutés au fichier de conf Summary of changes: .gitignore | 2 +- README | 17 +++++++++++------ app/mum.py | 12 +++++++----- install.sh | 16 +--------------- mum.conf | 8 ++++++++ 5 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 mum.conf -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository mum. See http://git.chorem.org/mum.git commit df5ffd6cb31fa95bec754d9115ece4860e24aa81 Author: Alexis Guilbaud <guilbaud@codelutin.com> Date: Fri Mar 27 17:28:56 2015 +0100 fichier de conf ajouté de nouveau à git. il est nécessaire de faire une copie locale de ce fichier avant de le modifier => README mis à jour ainsi que script install.sh + paramètres du service ajoutés au fichier de conf --- .gitignore | 2 +- README | 17 +++++++++++------ app/mum.py | 12 +++++++----- install.sh | 16 +--------------- mum.conf | 8 ++++++++ 5 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index 057b930..d3e158e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ mum.db */pyc /*.pyc */*.pyc -mum.conf \ No newline at end of file +mum.conf.local \ No newline at end of file diff --git a/README b/README index 8a983ae..23e3eca 100644 --- a/README +++ b/README @@ -24,16 +24,21 @@ apt-get install python2.7-dev You need also Virtualenv: sudo pip install virtualenv -Run the install script (it will install python dependences by Pip, create the conf file and create the basic folders -in ~/.mum): +Run the install script (it will install python dependences with Pip): ./install.sh -Edit mum.conf file if necessary +Copy the mum.conf file to create a local configuration file. + +Edit this local configuration file. To get informations about each field, type : ./run.sh -h Launch the server : -./run.sh +./run.sh location_of_local_conf_file + +You can also overwrite a filed of the configuration file by adding "--field value" arguments on the command line. To get +all avaliable arguments, type : +./run.sh -h -The service will be avaliable on 0.0.0.0:1337 +The service will be avaliable by default on 0.0.0.0:1337 --------- Updates @@ -43,7 +48,7 @@ git pull bower install -edit mum.conf +edit local configuration file remove database diff --git a/app/mum.py b/app/mum.py index 89bf69c..ca09f2e 100755 --- a/app/mum.py +++ b/app/mum.py @@ -190,9 +190,11 @@ if __name__ == '__main__': # creating the parser for the command line arguments parser = argparse.ArgumentParser() parser.add_argument("conf_loc", help="the location of the configuration file (can be relative)") - parser.add_argument("--db_location", help="the location of the shelve database") - parser.add_argument("--external_modules_location", help="the location of the external monitoring modules") - parser.add_argument("--keys_location", help="the location of the directory containing the SSH keys") + parser.add_argument("--server_port", type=int, help="the port of the service. REQUIRED") + parser.add_argument("--server_addr", help="the address of the service. REQUIRED") + parser.add_argument("--db_location", help="the location of the shelve database. REQUIRED") + parser.add_argument("--external_modules_location", help="the location of the external monitoring modules. REQUIRED") + parser.add_argument("--keys_location", help="the location of the directory containing the SSH keys.") parser.add_argument("--smtp_server", help="the name of the SMTP server to send e-mail notifications") parser.add_argument("--smtp_port", help="the port of the SMTP server") parser.add_argument("--smtp_address", help="the e-mail address of the sender for the e-mail notifications") @@ -221,7 +223,7 @@ if __name__ == '__main__': #dict_notif = ml.db.add_check('127.0.0.1', "ping", False) #ml.run_notification_modules(dict_notif) process_monitoring.init(ml, wsc) - port = int(os.environ.get('PORT', 1337)) - run(host='0.0.0.0', port=port, debug=True, server=GeventWebSocketServer) + port = int(os.environ.get('PORT', int(conf['server_port']))) + run(host=conf['server_addr'], port=port, debug=True, server=GeventWebSocketServer) # after ending process_monitoring.end = True \ No newline at end of file diff --git a/install.sh b/install.sh index 090594e..0eed87d 100755 --- a/install.sh +++ b/install.sh @@ -7,18 +7,4 @@ venv/bin/python --version >/dev/null 2>&1 || virtualenv venv sed -i 's/{{/[[/g' venv/bin/bottle.py sed -i 's/}}/]]/g' venv/bin/bottle.py sed -i 's/{{/[[/g' venv/lib/python2.7/site-packages/bottle.py -sed -i 's/}}/]]/g' venv/lib/python2.7/site-packages/bottle.py - -#creating the configuration file -touch mum.conf -echo "db_location=$HOME/.mum/mum.db" >> mum.conf -echo "external_modules_location=$HOME/.mum/external" >> mum.conf -echo "keys_location=$HOME/.mum/keys/" >> mum.conf -echo "smtp_server=" >> mum.conf -echo "smtp_port=" >> mum.conf -echo "smtp_address=" >> mum.conf - -# creating the basic folders -mkdir $HOME/.mum -mkdir $HOME/.mum/external -mkdir $HOME/.mum/keys \ No newline at end of file +sed -i 's/}}/]]/g' venv/lib/python2.7/site-packages/bottle.py \ No newline at end of file diff --git a/mum.conf b/mum.conf new file mode 100644 index 0000000..1524f55 --- /dev/null +++ b/mum.conf @@ -0,0 +1,8 @@ +server_port=1337 +server_addr=0.0.0.0 +db_location=mum.db +external_modules_location= +keys_location= +smtp_server= +smtp_port= +smtp_address= \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm