forked from skylime/mi-core-base
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustomize
executable file
·56 lines (44 loc) · 1.37 KB
/
customize
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
#!/usr/bin/bash
set -o errexit
PATH=/opt/local/gnu/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin
PKGSRC_VERSION='2015Q3'
# Munin plugins
MUNIN_PLUGIN_VERSION='0.7'
MUNIN_PLUGINS="
cpu
df
iostat
load
uptime
users
vmstat
io_busy_zfs
io_bytes_zfs
io_ops_zfs
if_net0
pkg_audit
"
echo "* Use the skylime pkgsrc mirror"
echo "http://pkgsrc.smartos.skylime.net/packages/SmartOS/${PKGSRC_VERSION}/x86_64/All" > /opt/local/etc/pkgin/repositories.conf
pkg_admin rebuild
pkgin -y up
## MUNIN
echo "* Create munin template file that will be used during mdata setup"
cp /opt/local/etc/munin/munin-node.conf /opt/local/etc/munin/munin-node.conf.tpl
echo "* Download and install community munin plugins (overwrite all other plugins)"
curl -L https://github.com/drscream/smartos-munin-plugins/archive/v${MUNIN_PLUGIN_VERSION}.tar.gz | gtar xz -C /opt/local/lib/munin/plugins --strip-components=1
echo "* Activate munin plugins"
/opt/core/bin/munin-node-plugins ${MUNIN_PLUGINS}
echo "* Create rsyslog.d folder for extra configuration files"
mkdir -p /opt/local/etc/rsyslog.d
## NAGIOS
echo "* Create nagios nrpe custom config requirements"
cat << 'EOF' >> /opt/local/etc/nagios/nrpe.cfg
# custom configuration:
# place all custom directives here
include=/opt/local/etc/nagios/nrpe_custom.cfg
EOF
mkdir -p /opt/local/etc/nagios/nrpe.d
echo "* Cleaning up."
rm -rf /root/*
sm-prepare-image -y