Menu

Nagios Backup

The backup script dump the content and the logs of Nagios

Show Source Code
module.exports = header: 'Nagios Backup', handler: ->
  {nagios} = @config.ryba

Database

Show Source Code
# module.exports.push header: 'Database', handler: ->
#   {nagios} = @config.ryba
#   username = hive.site['javax.jdo.option.ConnectionUserName']
#   password = hive.site['javax.jdo.option.ConnectionPassword']
#   {engine, db, hostname, port} = db.jdbc hive.site['javax.jdo.option.ConnectionURL']
#   engines =
#     mysql: ->
#       escape = (text) -> text.replace(/[\\"]/g, "\\$&")
#       @tools.backup
#         cmd: """
#         mysqldump -u{username} -p#{password} -h#{hostname} -P#{port} #{db}
#         """
#         target: '/var/backup/ryba/nagios/'
#       , next
#   return next new Error 'Database engine not supported' unless engines[engine]
#   engines[engine]()

Logs

Archive the logs generated by Nagios.

Show Source Code
  @tools.backup
    header: 'Logs'
    name: 'logs'
    source: nagios.log_dir
    filter: "nagios.log*"
    target: nagios.backup_dir
    interval: month: 1
    retention: count: 2

Configuration

Backup the active Nagios configuration.

Show Source Code
  @system.backup
    header: 'Configuration'
    name: 'conf'
    source: '/etc/nagios'
    target: nagios.backup_dir
    interval: month: 1
    retention: count: 2