Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

configure zabbix

  • Loading branch information...
commit 96d71f6afd59121b2c1b34f71399231ec5d60c90 1 parent 2cc5b8b
@Dieken authored
View
1  sysadmin/shell/etc/apache2/sites-available/monitor
@@ -16,6 +16,7 @@
Include /etc/pnp4nagios/apache.conf
Include /etc/munin/apache.conf
Include /etc/ganglia-webfrontend/apache.conf
+ Include /etc/zabbix/apache.conf
<Directory /srv/www/monitor>
AuthType Kerberos
View
4 sysadmin/shell/etc/dbconfig-common/zabbix-frontend-php.conf
@@ -29,7 +29,7 @@ dbc_dbuser='zabbix'
# dbc_dbpass: database user password
# the password to use with the above username when connecting
# to a database, if one is required
-dbc_dbpass=''
+dbc_dbpass='@@ZABBIX_DB_PASSWORD@@'
# dbc_dbserver: database host.
# leave unset to use localhost (or a more efficient local method
@@ -68,7 +68,7 @@ dbc_ssl=''
# see the section titled "AUTHENTICATION METHODS" in
# /usr/share/doc/dbconfig-common/README.pgsql for more info
dbc_authmethod_admin='ident'
-dbc_authmethod_user=''
+dbc_authmethod_user='password'
##
## end postgresql specific settings
View
4 sysadmin/shell/etc/dbconfig-common/zabbix-server-pgsql.conf
@@ -29,7 +29,7 @@ dbc_dbuser='zabbix'
# dbc_dbpass: database user password
# the password to use with the above username when connecting
# to a database, if one is required
-dbc_dbpass=''
+dbc_dbpass='@@ZABBIX_DB_PASSWORD@@'
# dbc_dbserver: database host.
# leave unset to use localhost (or a more efficient local method
@@ -68,7 +68,7 @@ dbc_ssl=''
# see the section titled "AUTHENTICATION METHODS" in
# /usr/share/doc/dbconfig-common/README.pgsql for more info
dbc_authmethod_admin='ident'
-dbc_authmethod_user='ident'
+dbc_authmethod_user='password'
##
## end postgresql specific settings
View
12 sysadmin/shell/etc/zabbix/apache.conf
@@ -2,3 +2,15 @@
<IfModule mod_alias.c>
Alias /zabbix /usr/share/zabbix
</IfModule>
+
+<Directory /usr/share/zabbix>
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+ Deny from none
+
+ AuthType Kerberos
+ Require valid-user
+
+ Options ExecCGI
+</Directory>
View
2  sysadmin/shell/etc/zabbix/dbconfig.php
@@ -12,7 +12,7 @@
$DB["PORT"] = "0";
$DB["DATABASE"] = "zabbix";
$DB["USER"] = "zabbix";
-$DB["PASSWORD"] = "";
+$DB["PASSWORD"] = "@@ZABBIX_DB_PASSWORD@@";
$ZBX_SERVER = "127.0.0.1";
$ZBX_SERVER_PORT = "10051";
View
2  sysadmin/shell/etc/zabbix/zabbix_server.conf
@@ -107,7 +107,7 @@ DBUser=zabbix
# Mandatory: no
# Default:
# DBPassword=
-DBPassword=
+DBPassword=@@ZABBIX_DB_PASSWORD@@
### Option: DBSocket
# Path to MySQL socket.
View
49 sysadmin/shell/monitoring.sh
@@ -74,6 +74,47 @@ cmp_dir $SCRIPT_DIR/etc/ganglia-webfrontend /etc/ganglia-webfrontend || {
APACHE_CONF_CHANGED=1
}
+######################################################################
+ensure_service_started postgresql postgres
+
+cmp_file $SCRIPT_DIR/etc/default/snmpd /etc/default/snmpd || {
+ overwrite_file $SCRIPT_DIR/etc/default/snmpd /etc/default/snmpd
+ SNMPD_CONF_CHANGED=1
+}
+
+cmp_dir $SCRIPT_DIR/etc/snmp /etc/snmp || {
+ overwrite_dir $SCRIPT_DIR/etc/snmp /etc/snmp
+ SNMPD_CONF_CHANGED=1
+}
+
+cmp_dir $SCRIPT_DIR/etc/zabbix /etc/zabbix --exclude dbconfig.php --exclude zabbix_server.conf || {
+ overwrite_dir $SCRIPT_DIR/etc/zabbix /etc/zabbix --exclude dbconfig.php --exclude zabbix_server.conf
+ ZABBIX_CONF_CHANGED=1
+ APACHE_CONF_CHANGED=1
+}
+
+f=/etc/dbconfig-common/zabbix-server-pgsql.conf
+tmpl=$SCRIPT_DIR$f
+dummy='@@ZABBIX_DB_PASSWORD@@'
+isnew=
+set +x
+parse_password_by_pattern "dbc_dbpass\\s*=\\s*['\"]([^'\"]+)" $f $dummy db_passwd isnew
+[ ! "$isnew" ] || pg_set_role_password zabbix "$db_passwd"
+
+substitude_template "$tmpl" "$f" 600 root:root ZABBIX_CONF_CHANGED -e "s/$dummy/$db_passwd/"
+
+f=/etc/dbconfig-common/zabbix-frontend-php.conf
+tmpl=$SCRIPT_DIR$f
+substitude_template "$tmpl" "$f" 600 root:root ZABBIX_CONF_CHANGED -e "s/$dummy/$db_passwd/"
+
+f=/etc/zabbix/dbconfig.php
+tmpl=$SCRIPT_DIR$f
+substitude_template "$tmpl" "$f" 640 root:www-data ZABBIX_CONF_CHANGED -e "s/$dummy/$db_passwd/"
+
+f=/etc/zabbix/zabbix_server.conf
+tmpl=$SCRIPT_DIR$f
+substitude_template "$tmpl" "$f" 640 root:root ZABBIX_CONF_CHANGED -e "s/$dummy/$db_passwd/"
+set -x
######################################################################
@@ -105,6 +146,7 @@ ensure_mode_user_group /etc/zabbix/zabbix_agentd.conf 644 root root
ensure_mode_user_group /etc/zabbix/zabbix_agentd.conf.d 755 root root
ensure_mode_user_group /etc/zabbix/zabbix_server.conf 640 root root
+ensure_mode_user_group /etc/default/snmpd 644 root root
ensure_mode_user_group /etc/snmp 755 root root
ensure_mode_user_group /etc/snmp/snmp.conf 644 root root
ensure_mode_user_group /etc/snmp/snmpd.conf 600 root root
@@ -113,6 +155,12 @@ ensure_mode_user_group /etc/snmp/snmptrapd.conf 600 root root
######################################################################
+[ -z "$SNMPD_CONF_CHANGED" ] || service snmpd restart
+[ -z "$ZABBIX_CONF_CHANGED" ] || {
+ service zabbix-server restart
+ service zabbix-agent restart
+}
+
[ -z "$GANGLIA_CONF_CHANGED" ] || {
service ganglia-monitor restart
service gmetad restart
@@ -134,7 +182,6 @@ ensure_mode_user_group /etc/snmp/snmptrapd.conf 600 root root
######################################################################
-ensure_service_started postgresql postgres
ensure_service_started snmpd snmpd
ensure_service_started zabbix-server zabbix_server
ensure_service_started zabbix-agent zabbix_agentd

0 comments on commit 96d71f6

Please sign in to comment.
Something went wrong with that request. Please try again.