salt.modules.nagios_rpc

Check Host & Service status from Nagios via JSON RPC.

2015.8.0 新版功能.

salt.modules.nagios_rpc.host_status(hostname=None, **kwargs)

Check status of a particular host By default statuses are returned in a numeric format.

Parameters:

hostname
The hostname to check the status of the service in Nagios.
numeric
Turn to false in order to return status in text format ('OK' instead of 0, 'Warning' instead of 1 etc)
返回:status: 'OK', 'Warning', 'Critical' or 'Unknown'

CLI Example:

salt '*' nagios_rpc.host_status hostname=webserver.domain.com
salt '*' nagios_rpc.host_status hostname=webserver.domain.com numeric=False
salt.modules.nagios_rpc.service_status(hostname=None, service=None, **kwargs)

Check status of a particular service on a host on it in Nagios. By default statuses are returned in a numeric format.

Parameters:

hostname
The hostname to check the status of the service in Nagios.
service
The service to check the status of in Nagios.
numeric
Turn to false in order to return status in text format ('OK' instead of 0, 'Warning' instead of 1 etc)
返回:status: 'OK', 'Warning', 'Critical' or 'Unknown'

CLI Example:

salt '*' nagios_rpc.service_status hostname=webserver.domain.com service='HTTP'
salt '*' nagios_rpc.service_status hostname=webserver.domain.com service='HTTP' numeric=False