Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
crans
OpenWrt-ChaosCalmer-UAPPro
Commits
c11149a8
Commit
c11149a8
authored
Jan 26, 2015
by
Gabriel Detraz
Browse files
Ajout du support de monit
parent
d4244a09
Changes
2
Hide whitespace changes
Inline
Side-by-side
files/etc/init.d/monit
0 → 100755
View file @
c11149a8
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2012 OpenWrt.org
START
=
60
SERVICE_USE_PID
=
1
start
()
{
[
-f
/etc/monitrc
]
||
return
1
ls
-l
/etc/monitrc |
grep
-q
'^-rw-------'
[
$?
-eq
0
]
||
chmod
0700 /etc/monitrc
service_start /usr/bin/monit
}
stop
()
{
service_stop /usr/bin/monit
}
files/etc/monitrc
0 → 100644
View file @
c11149a8
###############################################################################
## Monit Cr@ns Config !
###############################################################################
##
## Start Monit in the background (run as a daemon):
#
set daemon 60 # check services at 1-minute intervals
with start delay 30 # optional: delay the first check by 4-minutes (by
# # default Monit check immediately after Monit start)
set logfile syslog facility log_daemon
#set logfile /tmp/monit_log # Test logging
#
## Set the location of the Monit id file which stores the unique id for the
## Monit instance. The id is generated and stored on first Monit start. By
## default the file is placed in $HOME/.monit.id.
#
set idfile /var/.monit.id
# Bind and authorize only to localhost:
set httpd port 2812 and
use address localhost
allow localhost
#
## Set the location of the Monit state file which saves monitoring states
## on each cycle. By default the file is placed in $HOME/.monit.state. If
## the state file is stored on a persistent filesystem, Monit will recover
## the monitoring state across reboots. If it is on temporary filesystem, the
## state will be lost on reboot which may be convenient in some situations.
#
set statefile /var/.monit.state
## Check hostapd
check process hostapd-0 with pidfile /var/run/wifi-phy0.pid
start program = "/usr/sbin/hostapd -P /var/run/wifi-phy0.pid -B /var/run/hostapd-phy0.conf" with timeout 60 seconds
stop program = "/usr/bin/killall hostapd"
if 5 restarts within 5 cycles then timeout
check process hostapd-1 with pidfile /var/run/wifi-phy1.pid
start program = "/usr/sbin/hostapd -P /var/run/wifi-phy1.pid -B /var/run/hostapd-phy1.conf" with timeout 60 seconds
stop program = "/usr/bin/killall hostapd"
if 5 restarts within 5 cycles then timeout
check process sshd with pidfile /var/run/dropbear.1.pid
start program "/etc/init.d/dropbear start"
stop program "/etc/init.d/dropbear stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout
check program watch_net with path "/usr/share/watch_net/watch_net.sh"
if status != 0 then alert
check process logread with pidfile /var/run/logread.2.pid
start program "/etc/init.d start"
stop program "/etc/init.d stop"
if 5 restarts within 5 cycles then timeout
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment