Module Expr Str ImportFrom alias Import alias Import alias ImportFrom alias Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args defaults body Expr Str Return Str decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore BoolOpOr Call SubscriptLoad NameLoad Index Str Str Call SubscriptLoad NameLoad Index Str Str If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign NameStore BoolOpOr Call SubscriptLoad NameLoad Index Str Str Call SubscriptLoad NameLoad Index Str Str Assign NameStore BoolOpOr Call SubscriptLoad NameLoad Index Str Str Call SubscriptLoad NameLoad Index Str Str Return Dict Str Str Str NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad Assign NameStore NameLoad Assign NameStore Dict Str Str NameLoad NameLoad Assign NameStore Dict Str NameLoad If NameLoad body Assign SubscriptStore NameLoad Index Str Str If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If BoolOpAnd SubscriptLoad NameLoad Index Str CompareIsNot SubscriptLoad NameLoad Index Str NameLoad body Assign NameStore TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str orelse Assign NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr SubscriptLoad NameLoad Index Str keyword Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Dict keyword NameLoad keyword Str keyword NameLoad handlers ExceptHandler type NameLoad body Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad If CompareEq Call AttributeLoad NameLoad attr Str NameLoad AttributeLoad AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr attr body TryExcept body Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index Str NameLoad handlers ExceptHandler type NameLoad body Assign SubscriptStore NameLoad Index Str Str orelse If CompareEq Call AttributeLoad NameLoad attr Str NameLoad AttributeLoad AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr attr body Assign SubscriptStore NameLoad Index Str Str orelse If CompareEq Call AttributeLoad NameLoad attr Str NameLoad AttributeLoad AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr attr body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str orelse Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults NameLoad kwarg body Expr Str If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad Assign NameStore Dict Str SubscriptLoad NameLoad Index Str If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Dict attr Str Dict attr NameLoad Dict attr Str BoolOpOr BoolOpAnd UnaryOpNot NameLoad Str Num orelse Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad NameLoad kwarg body Expr Str If UnaryOpNot NameLoad body Raise Call NameLoad Str If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad Assign NameStore Dict Str SubscriptLoad NameLoad Index Str If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Dict attr Str Dict attr NameLoad Dict attr Str BoolOpOr BoolOpAnd UnaryOpNot NameLoad Str Num orelse Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str Return NameLoad decorator_list
N/A N/A 
Check Host & Service status from Nagios via JSON RPC.

.. versionadded:: 2015.8.0

 __future__ absolute_import N/A logging N/A salt.ext.six.moves.http_client salt.exceptions CommandExecutionError N/A salt.utils.http N/A log N/A N/A logging getLogger __name__ __virtual__ N/A N/A N/A N/A N/A 
    Only load if requests is successfully imported
     N/A nagios_rpc N/A _config N/A N/A N/A N/A N/A 
    Get configuration items for URL, Username and Password
     N/A status_url N/A N/A N/A __salt__ N/A config.get nagios.status_url N/A N/A __salt__ N/A config.get nagios:status_url N/A N/A status_url N/A N/A N/A CommandExecutionError Missing Nagios URL in the configuration. N/A username N/A N/A N/A __salt__ N/A config.get nagios.username N/A N/A __salt__ N/A config.get nagios:username N/A password N/A N/A N/A __salt__ N/A config.get nagios.password N/A N/A __salt__ N/A config.get nagios:password N/A N/A url username password status_url username password N/A _status_query N/A N/A query hostname enumerate service N/A None None N/A N/A 
    Send query along to Nagios.
     N/A config N/A _config N/A data None N/A params N/A hostname query hostname query N/A ret N/A result False N/A enumerate N/A N/A N/A params N/A formatoptions enumerate N/A service N/A N/A N/A params N/A servicedescription service N/A N/A N/A config N/A username N/A N/A config N/A password None N/A N/A auth N/A N/A config N/A username N/A config N/A password N/A N/A auth None N/A N/A N/A result N/A N/A N/A N/A salt utils http query N/A config N/A url method GET params params decode True data data text True status True header_dict N/A auth auth backend requests opts __opts__ N/A N/A N/A ValueError N/A N/A N/A ret N/A error Please ensure Nagios is running. N/A N/A ret N/A result False N/A ret N/A N/A N/A N/A result get status None N/A N/A N/A N/A N/A salt ext six moves http_client OK N/A N/A N/A N/A N/A ret N/A json_data N/A result N/A dict N/A N/A ret N/A result True N/A N/A N/A ValueError N/A N/A N/A ret N/A error Please ensure Nagios is running. N/A N/A N/A N/A N/A result get status None N/A N/A N/A N/A N/A salt ext six moves http_client UNAUTHORIZED N/A N/A N/A ret N/A error Authentication failed. Please check the configuration. N/A N/A N/A N/A N/A result get status None N/A N/A N/A N/A N/A salt ext six moves http_client NOT_FOUND N/A N/A N/A ret N/A error N/A N/A URL {0} was not found. format N/A config N/A url N/A N/A N/A ret N/A error N/A N/A Results: {0} format N/A result text N/A ret N/A host_status N/A N/A hostname N/A None kwargs N/A N/A 
    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)

    :return: status:     'OK', 'Warning', 'Critical' or 'Unknown'

    CLI Example:

    .. code-block:: bash

        salt '*' nagios_rpc.host_status hostname=webserver.domain.com
        salt '*' nagios_rpc.host_status hostname=webserver.domain.com numeric=False
     N/A N/A hostname N/A N/A N/A CommandExecutionError Missing hostname parameter N/A target host N/A numeric N/A N/A kwargs get numeric N/A data N/A _status_query target hostname enumerate numeric N/A ret N/A result N/A data N/A result N/A N/A ret N/A result N/A N/A N/A ret N/A status N/A N/A N/A N/A N/A N/A N/A N/A data get json_data N/A get data N/A get target N/A get status N/A N/A N/A numeric Unknown 2 N/A N/A N/A ret N/A error N/A data N/A error N/A ret N/A service_status N/A N/A hostname service N/A None None kwargs N/A N/A 
    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)

    :return: status:     'OK', 'Warning', 'Critical' or 'Unknown'

    CLI Example:

    .. code-block:: bash

        salt '*' nagios_rpc.service_status hostname=webserver.domain.com service='HTTP'
        salt '*' nagios_rpc.service_status hostname=webserver.domain.com service='HTTP' numeric=False
     N/A N/A hostname N/A N/A N/A CommandExecutionError Missing hostname parameter N/A N/A service N/A N/A N/A CommandExecutionError Missing service parameter N/A target service N/A numeric N/A N/A kwargs get numeric N/A data N/A _status_query target hostname service service enumerate numeric N/A ret N/A result N/A data N/A result N/A N/A ret N/A result N/A N/A N/A ret N/A status N/A N/A N/A N/A N/A N/A N/A N/A data get json_data N/A get data N/A get target N/A get status N/A N/A N/A numeric Unknown 2 N/A N/A N/A ret N/A error N/A data N/A error N/A ret N/A