mirror of
https://github.com/viq/NewsBlur.git
synced 2025-04-13 09:38:09 +00:00
Adding monit script for watching node real-time server.
This commit is contained in:
parent
a5e617c993
commit
123de0dcb7
4 changed files with 29 additions and 2 deletions
19
config/monit_node.conf
Normal file
19
config/monit_node.conf
Normal file
|
@ -0,0 +1,19 @@
|
|||
set daemon 120
|
||||
|
||||
set logfile /var/log/monit.log
|
||||
|
||||
set eventqueue
|
||||
basedir /var/monit # set the base directory where events will be stored
|
||||
slots 100 # optionally limit the queue size
|
||||
|
||||
# If no real-time updates in last 10 minutes, something is wrong
|
||||
check file node-newsblur.log with path /srv/newsblur/logs/newsblur.log
|
||||
if timestamp > 10 minutes then exec "/srv/newsblur/utils/kill_node.sh"
|
||||
# as uid sclay and gid sclay
|
||||
|
||||
check system node_server
|
||||
if loadavg (1min) > 12 then exec "/srv/newsblur/utils/kill_node.sh"
|
||||
# as uid sclay and gid sclay
|
||||
if loadavg (5min) > 8 then exec "/srv/newsblur/utils/kill_node.sh"
|
||||
# as uid sclay and gid sclay
|
||||
|
5
fabfile.py
vendored
5
fabfile.py
vendored
|
@ -535,6 +535,11 @@ def config_monit_task():
|
|||
sudo('echo "startup=1" > /etc/default/monit')
|
||||
sudo('/etc/init.d/monit restart')
|
||||
|
||||
def config_monit_node():
|
||||
put('config/monit_node.conf', '/etc/monit/conf.d/node.conf', use_sudo=True)
|
||||
sudo('echo "startup=1" > /etc/default/monit')
|
||||
sudo('/etc/init.d/monit restart')
|
||||
|
||||
def config_monit_app():
|
||||
put('config/monit_app.conf', '/etc/monit/conf.d/gunicorn.conf', use_sudo=True)
|
||||
sudo('echo "startup=1" > /etc/default/monit')
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
// #define BACKGROUND_REFRESH_SECONDS -5
|
||||
#define BACKGROUND_REFRESH_SECONDS -10*60
|
||||
|
||||
#define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.com"]
|
||||
// #define NEWSBLUR_URL [NSString stringWithFormat:@"www.newsblur.com"]
|
||||
// #define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.com"]
|
||||
#define NEWSBLUR_URL [NSString stringWithFormat:@"www.newsblur.com"]
|
||||
|
||||
#define NEWSBLUR_LINK_COLOR 0x405BA8
|
||||
#define NEWSBLUR_HIGHLIGHT_COLOR 0xd2e6fd
|
||||
|
|
3
utils/kill_node.sh
Executable file
3
utils/kill_node.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
sudo supervisorctl reload
|
Loading…
Add table
Reference in a new issue