nagios generate

Generates a Nagios Object Definition file that describes the cluster nodes and the services running on each.

Syntax

CLI
maprcli nagios generate
                     [ -cluster <cluster> ]
REST
http[s]://<host>:<port>/rest/nagios/generate?<parameters> 

Parameters

Parameter

Description

cluster

The cluster on which to run the command.

Output

Sample Output

############# Commands #############

define command {
  command_name    check_fileserver_proc
  command_line    $USER1$/check_tcp -p 5660
}

define command {
   command_name    check_cldb_proc
   command_line    $USER1$/check_tcp -p 7222
}

define command {
   command_name    check_jobtracker_proc
   command_line    $USER1$/check_tcp -p 50030
}

define command {
   command_name    check_tasktracker_proc
   command_line    $USER1$/check_tcp -p 50060
}

define command {
   command_name    check_nfs_proc
   command_line    $USER1$/check_tcp -p 2049
}

define command {
   command_name    check_hbmaster_proc
   command_line    $USER1$/check_tcp -p 60000
}

define command {
   command_name    check_hbregionserver_proc
   command_line    $USER1$/check_tcp -p 60020
}

define command {
   command_name    check_webserver_proc
   command_line    $USER1$/check_tcp -p 8443
}

################# HOST: host1 ###############

define host {
  use linux-server
  host_name host1
  address 192.168.1.1
  check_command check-host-alive
}

################# HOST: host2 ###############

define host {
  use linux-server
  host_name host2
  address 192.168.1.2
  check_command check-host-alive
}

Examples

Generate a nagios configuration, specifying cluster name and ZooKeeper nodes:

CLI
maprcli nagios generate -cluster cluster-1
REST
https://host1:8443/rest/nagios/generate?cluster=cluster-1

Generate a nagios configuration and save to the file nagios.conf:

CLI
maprcli nagios generate > nagios.conf