Setup zabbix-server22 » Historie » Version 4
Jeremias Keihsler, 08.02.2018 08:20
| 1 | 1 | Jeremias Keihsler | h1. Install Zabbix Server 2.2.x |
|---|---|---|---|
| 2 | |||
| 3 | h2. preliminary note |
||
| 4 | |||
| 5 | 3 | Jeremias Keihsler | this procedure is based on [[dw_os_cos6:Setup_zabbix-server22]] |
| 6 | 1 | Jeremias Keihsler | |
| 7 | you may also check |
||
| 8 | https://www.zabbix.com/documentation/2.2/manual/installation/install_from_packages |
||
| 9 | |||
| 10 | **this procedure has not yet been used or tested, use with caution** |
||
| 11 | remove this flag as soon as the first installation has succeeded. |
||
| 12 | |||
| 13 | * [[repo_epel|EPEL]] |
||
| 14 | * [[setup_apache| Apache]] |
||
| 15 | * [[setup_mariadb| MariaDB]] |
||
| 16 | |||
| 17 | h2. Server-Install |
||
| 18 | |||
| 19 | <pre><code class="bash"> |
||
| 20 | yum update |
||
| 21 | yum install httpd httpd-devel |
||
| 22 | yum install zabbix22-server-mysql zabbix22-agent zabbix22-web-mysql |
||
| 23 | yum install mariadb-server |
||
| 24 | systemctl start httpd.service |
||
| 25 | systemctl enable httpd.service |
||
| 26 | systemctl start mariadb.service |
||
| 27 | systemctl enable mariadb.service |
||
| 28 | /usr/bin/mysql_secure_installation |
||
| 29 | mysql -u root -p |
||
| 30 | </code></pre> |
||
| 31 | <pre><code class="bash"> |
||
| 32 | mysql> create database zabbix character set utf8 collate utf8_bin; |
||
| 33 | mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password'; |
||
| 34 | mysql> exit |
||
| 35 | </code></pre> |
||
| 36 | <pre><code class="bash"> |
||
| 37 | cd /usr/share/zabbix-mysql/ |
||
| 38 | mysql -u root -p zabbix < schema.sql |
||
| 39 | mysql -u root -p zabbix < images.sql |
||
| 40 | mysql -u root -p zabbix < data.sql |
||
| 41 | vim /etc/zabbix/zabbix_server.conf |
||
| 42 | </code></pre> |
||
| 43 | <pre> |
||
| 44 | # line 116: uncomment and add DB password for Zabbix |
||
| 45 | DBPassword=password |
||
| 46 | </pre> |
||
| 47 | <pre><code class="bash"> |
||
| 48 | vim /etc/zabbix/zabbix_agentd.conf |
||
| 49 | </code></pre> |
||
| 50 | <pre> |
||
| 51 | # line 133: change to your hostname |
||
| 52 | Hostname=zabbix.server.com |
||
| 53 | </pre> |
||
| 54 | <pre><code class="bash"> |
||
| 55 | vim /etc/php.ini |
||
| 56 | </code></pre> |
||
| 57 | <pre> |
||
| 58 | # line 384: change to Zabbix recommended |
||
| 59 | max_execution_time = 300 |
||
| 60 | |||
| 61 | # line 394: change to Zabbix recommended |
||
| 62 | max_input_time = 300 |
||
| 63 | |||
| 64 | # line 405: change to Zabbix recommended |
||
| 65 | memory_limit = 128M |
||
| 66 | |||
| 67 | # line 672: change to Zabbix recommended |
||
| 68 | post_max_size = 16M |
||
| 69 | |||
| 70 | # line 800: change to Zabbix recommended |
||
| 71 | upload_max_filesize = 2M |
||
| 72 | |||
| 73 | # line 879: uncomment and add your timezone |
||
| 74 | date.timezone = Europe/Vienna |
||
| 75 | </pre> |
||
| 76 | <pre><code class="bash"> |
||
| 77 | systemctl start zabbix-server |
||
| 78 | systemctl enable zabbix-server-mysql |
||
| 79 | systemctl start zabbix-agent |
||
| 80 | systemctl enable zabbix-agent |
||
| 81 | systemctl restart httpd |
||
| 82 | </code></pre> |
||
| 83 | |||
| 84 | h3. Firewall |
||
| 85 | |||
| 86 | if you are going to monitor other systems than the @localhost@ then you have to open ports @10050@ and @10051@ |
||
| 87 | |||
| 88 | <pre><code class="bash"> |
||
| 89 | firewall-cmd --permanent --add-port=10050/tcp |
||
| 90 | firewall-cmd --permanent --add-port=10051/tcp |
||
| 91 | systemctl restart firewalld |
||
| 92 | </code></pre> |
||
| 93 | |||
| 94 | h3. SELinux |
||
| 95 | |||
| 96 | as SELinux prevents the web-client to establish a connection to @localhost:10050@ you will get a wrong indication on Server-Status. Allow access to the server via |
||
| 97 | <pre><code class="bash"> |
||
| 98 | setsebool -P httpd_can_connect_zabbix 1 |
||
| 99 | </code></pre> |
||
| 100 | |||
| 101 | 4 | Jeremias Keihsler | as SELinux prevents zabbix from fetching the SSH-state you will get a wrong indication on SSH-Status. Allow access to the service via |
| 102 | <pre><code class="bash"> |
||
| 103 | setsebool -P zabbix_can_network on |
||
| 104 | </code></pre> |
||
| 105 | |||
| 106 | |||
| 107 | 1 | Jeremias Keihsler | h1. Backup Zabbix config |
| 108 | |||
| 109 | is taken from https://github.com/maxhq/zabbix-backup/ |
||
| 110 | |||
| 111 | This script is a simple way to backup all configuration tables (eg. templates, hostgroups, hosts, triggers…) without the history data. |
||
| 112 | |||
| 113 | As the result is very small, is possible run this backup many times per day. |
||
| 114 | |||
| 115 | The backup-script may be invoked by cron |
||
| 116 | |||
| 117 | @/etc/cron.d/zabbix-backup@ |
||
| 118 | <pre> |
||
| 119 | # JKE 2016-04-10 |
||
| 120 | # |
||
| 121 | # minute hour day month dayofweek |
||
| 122 | # m h d m d |
||
| 123 | # - - - - - |
||
| 124 | # | | | | | |
||
| 125 | # | | | | +-day of week (0-7) sunday=0 or 7 |
||
| 126 | # | | | +---month (1-12) |
||
| 127 | # | | +-----day of month (1-31) |
||
| 128 | # | +-------hour (0-23) |
||
| 129 | # +---------min (0-59) |
||
| 130 | # |
||
| 131 | 5 1 * * * root /usr/local/bin/zabbix-mysql-backupconf.sh -p password -o /var/cache/myzabbixdump -r 5 -q |
||
| 132 | </pre> |
||
| 133 | |||
| 134 | @zabbix-mysql-backupconf.sh@ |
||
| 135 | <pre> |
||
| 136 | #!/usr/bin/env bash |
||
| 137 | # |
||
| 138 | # NAME |
||
| 139 | # zabbix-mysql-dump - Configuration Backup for Zabbix with MySQL |
||
| 140 | # |
||
| 141 | # SYNOPSIS |
||
| 142 | # This is a MySQL configuration backup script for Zabbix 1.x and 2.x. |
||
| 143 | # It does a full backup of all configuration tables, but only a schema |
||
| 144 | # backup of large data tables. |
||
| 145 | # |
||
| 146 | # The script is based on a script by Ricardo Santos |
||
| 147 | # (http://zabbixzone.com/zabbix/backuping-only-the-zabbix-configuration/) |
||
| 148 | # |
||
| 149 | # CONTRIBUTORS |
||
| 150 | # - Ricardo Santos |
||
| 151 | # - Jens Berthold (maxhq) |
||
| 152 | # - Oleksiy Zagorskyi (zalex) |
||
| 153 | # - Petr Jendrejovsky |
||
| 154 | # - Jonathan Bayer |
||
| 155 | # - Andreas Niedermann (dre-) |
||
| 156 | # - Mi?u Moldovan (dumol) |
||
| 157 | # - Daniel Schneller (dschneller) |
||
| 158 | # |
||
| 159 | # HISTORY |
||
| 160 | # 0.8.0 (2016-01-22) |
||
| 161 | # FIX: Only invoke `dig` if available |
||
| 162 | # ENH: Option -c to use a MySQL config ("options") file (suggested by Daniel Schneller) |
||
| 163 | # ENH: Option -r to rotate backup files (Daniel Schneller) |
||
| 164 | # ENH: Add database version to filename if available |
||
| 165 | # ENH: Add quiet mode. IP reverse lookup optional (Daniel Schneller) |
||
| 166 | # ENH: Bash related fixes (Misu Moldovan) |
||
| 167 | # CHG: Default output directory is now $PWD instead of script dir |
||
| 168 | # |
||
| 169 | # 0.7.1 (2015-01-27) |
||
| 170 | # NEW: Parsing of commandline arguments implemented |
||
| 171 | # ENH: Try reverse lookup of IPs and include hostname/IP in filename |
||
| 172 | # REV: Stop if database password is wrong |
||
| 173 | # |
||
| 174 | # 0.7.0 (2014-10-02) |
||
| 175 | # ENH: Complete overhaul to make script work with lots of Zabbix versions |
||
| 176 | # |
||
| 177 | # 0.6.0 (2014-09-15) |
||
| 178 | # REV: Updated the table list for use with zabbix v2.2.3 |
||
| 179 | # |
||
| 180 | # 0.5.0 (2013-05-13) |
||
| 181 | # NEW: Added table list comparison between database and script |
||
| 182 | # |
||
| 183 | # 0.4.0 (2012-03-02) |
||
| 184 | # REV: Incorporated mysqldump options (suggested by Jonathan Bayer) |
||
| 185 | # |
||
| 186 | # 0.3.0 (2012-02-06) |
||
| 187 | # ENH: Backup of Zabbix 1.9.x / 2.0.0, removed unnecessary use of |
||
| 188 | # variables (DATEBIN etc) for commands that use to be in $PATH |
||
| 189 | # |
||
| 190 | # 0.2.0 (2011-11-05) |
||
| 191 | # |
||
| 192 | # AUTHOR |
||
| 193 | # Jens Berthold (maxhq), 2016 |
||
| 194 | |||
| 195 | |||
| 196 | # |
||
| 197 | # DEFAULT VALUES |
||
| 198 | # |
||
| 199 | # DO NOT EDIT THESE VALUES! |
||
| 200 | # Instead, use command line parameters or a config file to specify options. |
||
| 201 | # |
||
| 202 | DUMPDIR="$PWD" |
||
| 203 | DBHOST="127.0.0.1" |
||
| 204 | DBNAME="zabbix" |
||
| 205 | DBUSER="zabbix" |
||
| 206 | DBPASS="" |
||
| 207 | QUIET="no" |
||
| 208 | REVERSELOOKUP="yes" |
||
| 209 | GENERATIONSTOKEEP=0 |
||
| 210 | |||
| 211 | # |
||
| 212 | # SHOW HELP |
||
| 213 | # |
||
| 214 | if [ -z "$1" ]; then |
||
| 215 | cat <<EOF |
||
| 216 | USAGE |
||
| 217 | $(basename $BASH_SOURCE) [options] |
||
| 218 | |||
| 219 | OPTIONS |
||
| 220 | -h HOST |
||
| 221 | Hostname/IP of MySQL server. |
||
| 222 | Default: $DBHOST |
||
| 223 | |||
| 224 | -d DATABASE |
||
| 225 | Zabbix database name. |
||
| 226 | Default: $DBNAME |
||
| 227 | |||
| 228 | -u USER |
||
| 229 | MySQL user to access Zabbix database. |
||
| 230 | Default: $DBUSER |
||
| 231 | |||
| 232 | -p PASSWORD |
||
| 233 | MySQL user password (specify "-" for a prompt). |
||
| 234 | Default: no password |
||
| 235 | |||
| 236 | -o DIR |
||
| 237 | Save Zabbix MySQL dumps to DIR. |
||
| 238 | Default: $DUMPDIR |
||
| 239 | |||
| 240 | -c FILE |
||
| 241 | Use FILE for MySQL options (passed via --defaults-extra-file). |
||
| 242 | PLEASE NOTE: |
||
| 243 | mysqldump needs the database to be specified via command line. |
||
| 244 | So the first "database" options found in the config file is |
||
| 245 | used for mysqldump. |
||
| 246 | |||
| 247 | -r NUM |
||
| 248 | Rotate backups while keeping up to NUM generations. |
||
| 249 | Uses filename to match. |
||
| 250 | Default: keep all backups |
||
| 251 | |||
| 252 | -n |
||
| 253 | Skip reverse lookup of IP address for host. |
||
| 254 | |||
| 255 | -q |
||
| 256 | Quiet mode: no output except for errors (for batch/crontab use). |
||
| 257 | |||
| 258 | EXAMPLES |
||
| 259 | $(basename $BASH_SOURCE) -h 1.2.3.4 -d zabbixdb -u zabbix -p test |
||
| 260 | $(basename $BASH_SOURCE) -u zabbix -p - -o /tmp |
||
| 261 | $(basename $BASH_SOURCE) -c /etc/mysql/mysql.cnf |
||
| 262 | $(basename $BASH_SOURCE) -c /etc/mysql/mysql.cnf -d zabbixdb |
||
| 263 | |||
| 264 | EOF |
||
| 265 | exit 1 |
||
| 266 | fi |
||
| 267 | |||
| 268 | # |
||
| 269 | # PARSE COMMAND LINE ARGUMENTS |
||
| 270 | # |
||
| 271 | DB_GIVEN=0 |
||
| 272 | while getopts ":h:d:u:p:o:r:c:qn" opt; do |
||
| 273 | case $opt in |
||
| 274 | h) DBHOST="$OPTARG" ;; |
||
| 275 | d) DBNAME="$OPTARG"; DB_GIVEN=1 ;; |
||
| 276 | u) DBUSER="$OPTARG" ;; |
||
| 277 | p) DBPASS="$OPTARG" ;; |
||
| 278 | c) CNFFILE="$OPTARG" ;; |
||
| 279 | o) DUMPDIR="$OPTARG" ;; |
||
| 280 | r) GENERATIONSTOKEEP=$(printf '%.0f' "$OPTARG") ;; |
||
| 281 | n) REVERSELOOKUP="no" ;; |
||
| 282 | q) QUIET="yes" ;; |
||
| 283 | \?) echo "Invalid option: -$OPTARG" >&2; exit 1 ;; |
||
| 284 | :) echo "Option -$OPTARG requires an argument" >&2; exit 1 ;; |
||
| 285 | esac |
||
| 286 | done |
||
| 287 | |||
| 288 | # Password prompt |
||
| 289 | if [ "$DBPASS" = "-" ]; then |
||
| 290 | read -s -p "Enter MySQL password for user '$DBUSER' (input will be hidden): " DBPASS |
||
| 291 | echo "" |
||
| 292 | fi |
||
| 293 | |||
| 294 | # Config file validations |
||
| 295 | if [ ! -z "$CNFFILE" ]; then |
||
| 296 | if [ ! -r "$CNFFILE" ]; then |
||
| 297 | echo "ERROR: Cannot read configuration file $CNFFILE" >&2 |
||
| 298 | exit 1 |
||
| 299 | fi |
||
| 300 | # Database name needs special treatment: |
||
| 301 | # For mysqldump it has to be specified on the command line! |
||
| 302 | # Therefore we need to get it from the config file |
||
| 303 | if [ $DB_GIVEN -eq 0 ]; then |
||
| 304 | DBNAME=$(grep -m 1 ^database= "$CNFFILE" | cut -d= -f2) |
||
| 305 | fi |
||
| 306 | fi |
||
| 307 | |||
| 308 | # |
||
| 309 | # CONSTANTS |
||
| 310 | # |
||
| 311 | MYSQL_OPTS=() |
||
| 312 | [ ! -z "$CNFFILE" ] && MYSQL_OPTS=("${MYSQL_OPTS[@]}" --defaults-extra-file="$CNFFILE") |
||
| 313 | [ ! -z "$DBHOST" ] && MYSQL_OPTS=("${MYSQL_OPTS[@]}" -h $DBHOST) |
||
| 314 | [ ! -z "$DBUSER" ] && MYSQL_OPTS=("${MYSQL_OPTS[@]}" -u $DBUSER) |
||
| 315 | [ ! -z "$DBPASS" ] && MYSQL_OPTS=("${MYSQL_OPTS[@]}" -p"$DBPASS") |
||
| 316 | |||
| 317 | MYSQL_OPTS_BATCH=("${MYSQL_OPTS[@]}" --batch --silent) |
||
| 318 | [ ! -z "$DBNAME" ] && MYSQL_OPTS_BATCH=("${MYSQL_OPTS_BATCH[@]}" -D $DBNAME) |
||
| 319 | |||
| 320 | # Host name: try reverse lookup if IP is given |
||
| 321 | DBHOSTNAME="$DBHOST" |
||
| 322 | command -v dig >/dev/null 2>&1 |
||
| 323 | FIND_DIG=$? |
||
| 324 | if [ "$REVERSELOOKUP" == "yes" -a $FIND_DIG -eq 0 ]; then |
||
| 325 | # Try resolving a given host ip |
||
| 326 | newHostname=$(dig +noall +answer -x $DBHOST | sed -r 's/((\S+)\s+)+([^\.]+)\..*/\3/') |
||
| 327 | test \! -z "$newHostname" && DBHOSTNAME="$newHostname" |
||
| 328 | fi |
||
| 329 | |||
| 330 | # |
||
| 331 | # CONFIG DUMP |
||
| 332 | # |
||
| 333 | if [ "$QUIET" == "no" ]; then |
||
| 334 | cat <<-EOF |
||
| 335 | Configuration: |
||
| 336 | - host: $DBHOST ($DBHOSTNAME) |
||
| 337 | - database: $DBNAME |
||
| 338 | - user: $DBUSER |
||
| 339 | - output: $DUMPDIR |
||
| 340 | |||
| 341 | EOF |
||
| 342 | fi |
||
| 343 | |||
| 344 | # |
||
| 345 | # FUNCTIONS |
||
| 346 | # |
||
| 347 | |||
| 348 | # Returns TRUE if argument 1 is part of the given array (remaining arguments) |
||
| 349 | elementIn () { |
||
| 350 | local e |
||
| 351 | for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done |
||
| 352 | return 1 |
||
| 353 | } |
||
| 354 | |||
| 355 | # |
||
| 356 | # CHECKS |
||
| 357 | # |
||
| 358 | if [ ! -x /usr/bin/mysqldump ]; then |
||
| 359 | echo "mysqldump not found." >&2 |
||
| 360 | echo "(with Debian, \"apt-get install mysql-client\" will help)" >&2 |
||
| 361 | exit 1 |
||
| 362 | fi |
||
| 363 | |||
| 364 | # |
||
| 365 | # READ TABLE LIST from __DATA__ section at the end of this script |
||
| 366 | # (http://stackoverflow.com/a/3477269/2983301) |
||
| 367 | # |
||
| 368 | DATA_TABLES=() |
||
| 369 | while read line; do |
||
| 370 | table=$(echo "$line" | cut -d" " -f1) |
||
| 371 | echo "$line" | cut -d" " -f5 | grep -qi "DATA" |
||
| 372 | test $? -eq 0 && DATA_TABLES+=($table) |
||
| 373 | done < <(sed '0,/^__DATA__$/d' "$BASH_SOURCE" | tr -s " ") |
||
| 374 | |||
| 375 | # paranoid check |
||
| 376 | if [ ${#DATA_TABLES[@]} -lt 5 ]; then |
||
| 377 | echo "ERROR: The number of large data tables configured in this script is less than 5." >&2 |
||
| 378 | exit 1 |
||
| 379 | fi |
||
| 380 | |||
| 381 | # |
||
| 382 | # BACKUP |
||
| 383 | # |
||
| 384 | # Read table list from database |
||
| 385 | [ "$QUIET" == "no" ] && echo "Fetching list of existing tables..." |
||
| 386 | DB_TABLES=$(mysql "${MYSQL_OPTS_BATCH[@]}" -e "SELECT table_name FROM information_schema.tables WHERE table_schema = '$DBNAME'" 2>&1) |
||
| 387 | if [ $? -ne 0 ]; then echo -e "ERROR while trying to access database:\n$DB_TABLES" 2>&1; exit 1; fi |
||
| 388 | DB_TABLES=$(echo "$DB_TABLES" | sort) |
||
| 389 | DB_TABLE_NUM=$(echo "$DB_TABLES" | wc -l) |
||
| 390 | |||
| 391 | # Query Zabbix database version |
||
| 392 | VERSION="" |
||
| 393 | DB_VER=$(mysql "${MYSQL_OPTS_BATCH[@]}" -N -e "select optional from dbversion;" 2>&1) |
||
| 394 | if [ $? -eq 0 ]; then |
||
| 395 | # version string is like: 02030015 |
||
| 396 | re='(.*)([0-9]{2})([0-9]{4})' |
||
| 397 | if [[ $DB_VER =~ $re ]]; then |
||
| 398 | VERSION="_db-${BASH_REMATCH[1]}.$(( ${BASH_REMATCH[2]} + 0 )).$(( ${BASH_REMATCH[3]} + 0 ))" |
||
| 399 | fi |
||
| 400 | fi |
||
| 401 | |||
| 402 | # Assemble file name |
||
| 403 | DUMPFILENAME_PREFIX="zabbix_cfg_${DBHOSTNAME}" |
||
| 404 | DUMPFILEBASE="${DUMPFILENAME_PREFIX}_$(date +%Y%m%d-%H%M)${VERSION}.sql" |
||
| 405 | DUMPFILE="$DUMPDIR/$DUMPFILEBASE" |
||
| 406 | |||
| 407 | PROCESSED_DATA_TABLES=() |
||
| 408 | i=0 |
||
| 409 | |||
| 410 | mkdir -p "${DUMPDIR}" |
||
| 411 | |||
| 412 | [ "$QUIET" == "no" ] && echo "Starting table backups..." |
||
| 413 | while read table; do |
||
| 414 | # large data tables: only store schema |
||
| 415 | if elementIn "$table" "${DATA_TABLES[@]}"; then |
||
| 416 | dump_opt="--no-data" |
||
| 417 | PROCESSED_DATA_TABLES+=($table) |
||
| 418 | # configuration tables: full dump |
||
| 419 | else |
||
| 420 | dump_opt="--extended-insert=FALSE" |
||
| 421 | fi |
||
| 422 | |||
| 423 | mysqldump "${MYSQL_OPTS[@]}" \ |
||
| 424 | --routines --opt --single-transaction --skip-lock-tables \ |
||
| 425 | $dump_opt \ |
||
| 426 | $DBNAME --tables ${table} >> "$DUMPFILE" |
||
| 427 | |||
| 428 | if [ "$QUIET" == "no" ]; then |
||
| 429 | # show percentage |
||
| 430 | i=$((i+1)); i_percent=$(($i * 100 / $DB_TABLE_NUM)) |
||
| 431 | if [ $(($i_percent % 12)) -eq 0 ]; then |
||
| 432 | echo -n "${i_percent}%" |
||
| 433 | else |
||
| 434 | if [ $(($i_percent % 2)) -eq 0 ]; then echo -n "."; fi |
||
| 435 | fi |
||
| 436 | fi |
||
| 437 | done <<<"$DB_TABLES" |
||
| 438 | |||
| 439 | # |
||
| 440 | # COMPRESS BACKUP |
||
| 441 | # |
||
| 442 | if [ "$QUIET" == "no" ]; then |
||
| 443 | echo -e "\n" |
||
| 444 | echo "For the following large tables only the schema (without data) was stored:" |
||
| 445 | for table in "${PROCESSED_DATA_TABLES[@]}"; do echo " - $table"; done |
||
| 446 | |||
| 447 | echo |
||
| 448 | echo "Compressing backup file..." |
||
| 449 | fi |
||
| 450 | gzip -f "$DUMPFILE" |
||
| 451 | if [ $? -ne 0 ]; then |
||
| 452 | echo -e "\nERROR: Could not compress backup file, see previous messages" >&2 |
||
| 453 | exit 1 |
||
| 454 | fi |
||
| 455 | |||
| 456 | [ "$QUIET" == "no" ] && echo -e "\nBackup Completed:\n${DUMPFILE}.gz" |
||
| 457 | |||
| 458 | # |
||
| 459 | # ROTATE OLD BACKUPS |
||
| 460 | # |
||
| 461 | if [ $GENERATIONSTOKEEP -gt 0 ]; then |
||
| 462 | [ "$QUIET" == "no" ] && echo "Removing old backups, keeping up to $GENERATIONSTOKEEP" |
||
| 463 | REMOVE_OLD_CMD="cd \"$DUMPDIR\" && ls -t \"${DUMPFILENAME_PREFIX}\"* | /usr/bin/awk \"NR>${GENERATIONSTOKEEP}\" | xargs rm -f " |
||
| 464 | eval ${REMOVE_OLD_CMD} |
||
| 465 | if [ $? -ne 0 ]; then |
||
| 466 | echo "ERROR: Could not rotate old backups" >&2 |
||
| 467 | exit 1 |
||
| 468 | fi |
||
| 469 | fi |
||
| 470 | |||
| 471 | exit 0 |
||
| 472 | |||
| 473 | ################################################################################ |
||
| 474 | # List of all known table names and a flag indicating data (=large) tables |
||
| 475 | # |
||
| 476 | |||
| 477 | __DATA__ |
||
| 478 | acknowledges 1.3.1 - 2.4.0 DATA |
||
| 479 | actions 1.3.1 - 2.4.0 |
||
| 480 | alerts 1.3.1 - 2.4.0 DATA |
||
| 481 | application_template 2.1.0 - 2.4.0 |
||
| 482 | applications 1.3.1 - 2.4.0 |
||
| 483 | auditlog 1.3.1 - 2.4.0 DATA |
||
| 484 | auditlog_details 1.7 - 2.4.0 DATA |
||
| 485 | autoreg 1.3.1 - 1.3.4 |
||
| 486 | autoreg_host 1.7 - 2.4.0 |
||
| 487 | conditions 1.3.1 - 2.4.0 |
||
| 488 | config 1.3.1 - 2.4.0 |
||
| 489 | dbversion 2.1.0 - 2.4.0 |
||
| 490 | dchecks 1.3.4 - 2.4.0 |
||
| 491 | dhosts 1.3.4 - 2.4.0 |
||
| 492 | drules 1.3.4 - 2.4.0 |
||
| 493 | dservices 1.3.4 - 2.4.0 |
||
| 494 | escalations 1.5.3 - 2.4.0 |
||
| 495 | events 1.3.1 - 2.4.0 DATA |
||
| 496 | expressions 1.7 - 2.4.0 |
||
| 497 | functions 1.3.1 - 2.4.0 |
||
| 498 | globalmacro 1.7 - 2.4.0 |
||
| 499 | globalvars 1.9.6 - 2.4.0 |
||
| 500 | graph_discovery 1.9.0 - 2.4.0 |
||
| 501 | graph_theme 1.7 - 2.4.0 |
||
| 502 | graphs 1.3.1 - 2.4.0 |
||
| 503 | graphs_items 1.3.1 - 2.4.0 |
||
| 504 | group_discovery 2.1.4 - 2.4.0 |
||
| 505 | group_prototype 2.1.4 - 2.4.0 |
||
| 506 | groups 1.3.1 - 2.4.0 |
||
| 507 | help_items 1.3.1 - 2.1.8 |
||
| 508 | history 1.3.1 - 2.4.0 DATA |
||
| 509 | history_log 1.3.1 - 2.4.0 DATA |
||
| 510 | history_str 1.3.1 - 2.4.0 DATA |
||
| 511 | history_str_sync 1.3.1 - 2.2.6 DATA |
||
| 512 | history_sync 1.3.1 - 2.2.6 DATA |
||
| 513 | history_text 1.3.1 - 2.4.0 DATA |
||
| 514 | history_uint 1.3.1 - 2.4.0 DATA |
||
| 515 | history_uint_sync 1.3.1 - 2.2.6 DATA |
||
| 516 | host_discovery 2.1.4 - 2.4.0 |
||
| 517 | host_inventory 1.9.6 - 2.4.0 |
||
| 518 | host_profile 1.9.3 - 1.9.5 |
||
| 519 | hostmacro 1.7 - 2.4.0 |
||
| 520 | hosts 1.3.1 - 2.4.0 |
||
| 521 | hosts_groups 1.3.1 - 2.4.0 |
||
| 522 | hosts_profiles 1.3.1 - 1.9.2 |
||
| 523 | hosts_profiles_ext 1.6 - 1.9.2 |
||
| 524 | hosts_templates 1.3.1 - 2.4.0 |
||
| 525 | housekeeper 1.3.1 - 2.4.0 |
||
| 526 | httpstep 1.3.3 - 2.4.0 |
||
| 527 | httpstepitem 1.3.3 - 2.4.0 |
||
| 528 | httptest 1.3.3 - 2.4.0 |
||
| 529 | httptestitem 1.3.3 - 2.4.0 |
||
| 530 | icon_map 1.9.6 - 2.4.0 |
||
| 531 | icon_mapping 1.9.6 - 2.4.0 |
||
| 532 | ids 1.3.3 - 2.4.0 |
||
| 533 | images 1.3.1 - 2.4.0 |
||
| 534 | interface 1.9.1 - 2.4.0 |
||
| 535 | interface_discovery 2.1.4 - 2.4.0 |
||
| 536 | item_condition 2.3.0 - 2.4.0 |
||
| 537 | item_discovery 1.9.0 - 2.4.0 |
||
| 538 | items 1.3.1 - 2.4.0 |
||
| 539 | items_applications 1.3.1 - 2.4.0 |
||
| 540 | maintenances 1.7 - 2.4.0 |
||
| 541 | maintenances_groups 1.7 - 2.4.0 |
||
| 542 | maintenances_hosts 1.7 - 2.4.0 |
||
| 543 | maintenances_windows 1.7 - 2.4.0 |
||
| 544 | mappings 1.3.1 - 2.4.0 |
||
| 545 | media 1.3.1 - 2.4.0 |
||
| 546 | media_type 1.3.1 - 2.4.0 |
||
| 547 | node_cksum 1.3.1 - 2.2.6 |
||
| 548 | node_configlog 1.3.1 - 1.4.7 |
||
| 549 | nodes 1.3.1 - 2.2.6 |
||
| 550 | opcommand 1.9.4 - 2.4.0 |
||
| 551 | opcommand_grp 1.9.2 - 2.4.0 |
||
| 552 | opcommand_hst 1.9.2 - 2.4.0 |
||
| 553 | opconditions 1.5.3 - 2.4.0 |
||
| 554 | operations 1.3.4 - 2.4.0 |
||
| 555 | opgroup 1.9.2 - 2.4.0 |
||
| 556 | opmediatypes 1.7 - 1.8.21 |
||
| 557 | opmessage 1.9.2 - 2.4.0 |
||
| 558 | opmessage_grp 1.9.2 - 2.4.0 |
||
| 559 | opmessage_usr 1.9.2 - 2.4.0 |
||
| 560 | optemplate 1.9.2 - 2.4.0 |
||
| 561 | profiles 1.3.1 - 2.4.0 |
||
| 562 | proxy_autoreg_host 1.7 - 2.4.0 |
||
| 563 | proxy_dhistory 1.5 - 2.4.0 |
||
| 564 | proxy_history 1.5.1 - 2.4.0 |
||
| 565 | regexps 1.7 - 2.4.0 |
||
| 566 | rights 1.3.1 - 2.4.0 |
||
| 567 | screens 1.3.1 - 2.4.0 |
||
| 568 | screens_items 1.3.1 - 2.4.0 |
||
| 569 | scripts 1.5 - 2.4.0 |
||
| 570 | service_alarms 1.3.1 - 2.4.0 |
||
| 571 | services 1.3.1 - 2.4.0 |
||
| 572 | services_links 1.3.1 - 2.4.0 |
||
| 573 | services_times 1.3.1 - 2.4.0 |
||
| 574 | sessions 1.3.1 - 2.4.0 |
||
| 575 | slides 1.3.4 - 2.4.0 |
||
| 576 | slideshows 1.3.4 - 2.4.0 |
||
| 577 | sysmap_element_url 1.9.0 - 2.4.0 |
||
| 578 | sysmap_url 1.9.0 - 2.4.0 |
||
| 579 | sysmaps 1.3.1 - 2.4.0 |
||
| 580 | sysmaps_elements 1.3.1 - 2.4.0 |
||
| 581 | sysmaps_link_triggers 1.5 - 2.4.0 |
||
| 582 | sysmaps_links 1.3.1 - 2.4.0 |
||
| 583 | timeperiods 1.7 - 2.4.0 |
||
| 584 | trends 1.3.1 - 2.4.0 DATA |
||
| 585 | trends_uint 1.5 - 2.4.0 DATA |
||
| 586 | trigger_depends 1.3.1 - 2.4.0 |
||
| 587 | trigger_discovery 1.9.0 - 2.4.0 |
||
| 588 | triggers 1.3.1 - 2.4.0 |
||
| 589 | user_history 1.7 - 2.4.0 |
||
| 590 | users 1.3.1 - 2.4.0 |
||
| 591 | users_groups 1.3.1 - 2.4.0 |
||
| 592 | usrgrp 1.3.1 - 2.4.0 |
||
| 593 | valuemaps 1.3.1 - 2.4.0 |
||
| 594 | |||
| 595 | </pre> |