-
Notifications
You must be signed in to change notification settings - Fork 6
/
INSTALL
201 lines (144 loc) · 7.68 KB
/
INSTALL
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
SysUsage v5.7 - System Monitoring Tool
REQUIREMENT
rrdtool
You need to install rrdtool. All distribution may have a dedicated
package for rrdtool. On CentOs/RedHat distributions, use the following
command:
yum install rrdtool rrdtool-perl
on Debian/Ubuntu distributions use command:
apt-get install rrdtool librrds-perl
The sources can be found here:
http://people.ee.ethz.ch/~oetiker/
If you compile from sources and want to use the RRDs perl module
embedded with it, you must use the following command to compile:
make site-perl-install
This installation is optional if sysusage is installed on a remote host.
sysstat
You also need sar to collect statistics. Sar is part of the sysstat
package. For RPM like distributions:
yum install sysstat
and Debian like distributions:
apt-get install sysstat
The sources can always be found here :
http://freshmeat.net/projects/sysstat/
If you plan to use threshold notification you must have Net::SMTP
installed.
yum install perl-Net-SMTP-SSL
or
apt-get install libnet-smtp-ssl-perl
Sources can be found on CPAN (https://metacpan.org/pod/Net::SMTP)
Perl modules
Sysusage can be run in a central place to collect remote sysusage
statistics using ssh. The remote calls are proceed simultaneously using
fork with the Proc::Queue Perl module.
If you're plan tu use sysusagegraph instead of sysusagejqgrpah you will
also need the GD and GD::Graph3D Perl modules. Note that the use of GD
and GD::Graph is deprecated and sysusagegraph will be removed in next
major release (6.0).
All these modules are always available from CPAN (https://metacpan.org/)
and may at least be installed on the central server. On remote host this
is optional and depend if you want to run it on each server or by ssh
from a central place.
Nagios nsca client (optional)
If you want to send message to Nagios you need to install
nsca-2.7.2.tar.gz or a more recent version. You can get it here:
http://sourceforge.net/projects/nagios/files/
hddtemp and sensors (optional)
If you want to monitor your hard drive temperature you must install a
small utility called hddtemp. You can download it from
http://download.savannah.gnu.org/releases/hddtemp/. Run it to see if
your hard drive have a temperature sensor.
You can also use sensors to monitor your cpu temperature and fan speed.
If you harware support it run sensors-detect and load the required
kernel modules at boot time.
INSTALLATION
Quick install
Simply run the following commands:
perl Makefile.PL
make && make install
By default it will copy the perl programs into /usr/local/sysusage/bin
and the HTML output will be done to /var/www/htdocs/sysusage/. The
configuration file is /usr/local/sysusage/etc/sysusage.cfg and all RRD
Bekerley DB databases from rrdtool will be saved under
/usr/local/sysusage/rrdfiles.
If you plan to run sysusage on different servers from a central place
you may just want to install the rsysusage Perl script on remote hosts.
So proceed as follow:
perl Makefile.PL REMOTE=1
make && make install
It will copy the only the rsysusage into /usr/local/sysusage/bin and the
configuration file under /usr/local/sysusage/etc/sysusage.cfg. The RRD
data directory will be created under /usr/local/sysusage/rrdfiles but
just to hold the *.cnt files relatives to the count of alert attempt on
threshold exceed.
Custom install
You can overwrite all install path with the following Makefile.PL
arguments. Here are the default values:
BINDIR=/usr/local/sysusage/bin
CONFDIR=/usr/local/sysusage/etc
PIDDIR=/usr/local/sysusage/etc
BASEDIR=/usr/local/sysusage/rrdfiles
PLUGINDIR=/usr/local/sysusage/plugins
HTMLDIR=/var/www/htdocs/sysusage
MANDIR=/usr/local/sysusage/doc
DOCDIR=/usr/local/sysusage/doc
REMOTE=
For example on a RedHat System you may prefer install SysUsage as this:
perl Makefile.PL BINDIR=/usr/bin CONFDIR=/etc PIDDIR=/var/run \
BASEDIR=/var/lib/sysusage HTMLDIR=/var/www/html/sysusage \
MANDIR=/usr/man/man1 DOCDIR=/usr/share/doc/sysusage
If you are installing sysusage on a host that will be call by ssh from a
central place, you may want to install just what is necessary and not
more:
perl Makefile.PL BINDIR=/usr/bin CONFDIR=/etc PIDDIR=/var/run \
MANDIR=/usr/man/man1 DOCDIR=/usr/share/doc/sysusage \
REMOTE=1
This will just install the rsysusage Perl script, the configuration file
and documentation. So that you don't need to install extra Perl modules
and other graphics related things.
Package/binary install
In directory packaging/ you will find all scripts to build RPM,
slackBuild and debian package. See README in this directory to know how
to build these packages.
USAGE
SysUsage consist in two main Perl scripts, sysusage and sysusagegraph.
Once you have correctly installed and configured SysUsage the best way
to execute them is by setting a cron job. If you prefer javascript
graphics instead of GD::Graph images use sysusagejqgraph that is based
on jqplot javascript library. This is the recommanded script as use of
GD::Graph through sysusagegraph is deprecated.
sysusage
The script sysusage is responsible of collecting system informations at
a given interval and store them into rrdtool database files.
As it is very fast you can set running interval time to 1 minute. This
is the default pooling interval used in configuration and graph reports.
If you change this interval you must also change it in the configuration
file otherwise your graph will be false. See the INTERVAL configuration
directive.
Here is how I use it with a default installation:
*/1 * * * * /usr/local/sysusage/bin/sysusage > /dev/null 2>&1
rsysusage
This script do the same things as the sysusage Perl script but instead
of storing collected datas on file it will dump them to the standard
output. This script is used instead of the sysusage Perl script by a ssh
call from a central server where the local sysusage will store the
statistics retrieved from multiple servers.
/usr/local/sysusage/bin/rsysusage -r remote_hostname
Where 'remote_hostname' is the hostname given in the [REMOTE ...]
configuration section.
sysusagegraph (deprecated) / sysusagejqgraph
The perl script sysusagegraph is used to draw PNG graphs and write HTML
file. As he knows the pooling interval given in the configuration file
it can be run at any time. I used to run it each five minutes but you
can run it each hours or more this is the same.
*/5 * * * * /usr/local/sysusage/bin/sysusagegraph > /dev/null 2>&1
Since release v4.0 of SysUsage there's a JQuery plotting replacement of
rrdGraph that only write HTML files with all javascript code to allow
the client browser to draw the graphs. To enable this feature you just
have to use sysusagejqgrpah instead.
*/5 * * * * /usr/local/sysusage/bin/sysusagejqgraph > /dev/null 2>&1
There's some more resources javascript libraries and CSS files to
install. The SysUsage installer will do the job for you. This remove the
requirement of the GD, GD::Graph and GD::Graph3D Perl modules.
See README file for more information on configuration and others.
Enjoy,