-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
86 lines (61 loc) · 2.89 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
sysWatcher
==========
The sysWatcher project is a fully scriptable, generic event system. It
uses custom triggers to invoke a script or to send an email with
predetermined content. Event triggering is entirely handled by the
plugin scripts, hence the term "generic".
Installation
------------
The installation process is necessary because sysWatcher depends on
in-house scripts, which provide functions useful to plugins and the main
script alike. Functions for date and time malipulation are provided,
among others.
In your terminal, clone the sysWatcher repository using
`git clone git://xroutine.net/sysWatcher.git`.
Install the configuration and plugin files by typing `make install`.
This creates and populates the directory **/usr/share/sysWatcher**.
Finally, copy sysWatcher.sh to the installation path of your choice.
*Note: sysWatcher consists entirely of shell script and configuration
files, so no compiler commands are required.*
Configuration
-------------
The main script, **sysWatcher.sh**, looks for **sysWatcher.conf**, first
in the current directory (which may not be the installation directory),
then in /etc, and finally in /usr/local/etc. It will stop looking for
sysWatcher.conf at the first match.
**sysWatcher.conf** must contain at least three variables: **email**,
**eventDir** and **varDir**:
- **eventDir** tells sysWatcher which directory contains the plugin
scripts.
- **varDir** specifies a directory including items such as temporary
timeout files.
- **email** is the default recipient email.
More detailed configuration options are given in **sysWatcher.sh**.
Requirements
------------
A plugin script needs to include certain mandatory functions to work
properly. More details are given within **sysWatcher.sh**.
For reasons of compatibility, only **bash** and **zsh** are supported.
Some other shells such as **dash** lack some necessary features. It may
be possible to use **ksh**, but this has not been tested.
sysWatcher.sh uses the **mail** command to send emails. For this to work
you should have a mailing system (such as postfix) installed and
configured.
Running sysWatcher
------------------
You should schedule sysWatcher.sh as a regular job using cron or
similar. This allows sysWatcher to run as often or as rarely as you
wish.
### Adding a cron job
Open a terminal and type:
`sudo crontab -e`
This will open the cron table in your default text editor. Enter the
following after the comments:
`*/1 * * * * /bin/bash /usr/sbin/sysWatcher.sh`
The above example assumes you want to run sysWatcher.sh every minute.
Please note that the path may vary depending on where you choose to
install sysWatcher (see the Installation section for more details). Read
the man pages for **crontab(5)** and **cron(8)** for more details on
scheduling with cron.
It should be quite easy to run sysWatcher as a standalone daemon, but
this might be less useful than scheduling it as a cron job.