enrobie.plugins.nagios package#

Subpackages#

Submodules#

enrobie.plugins.nagios.ainswer module#

Functions and routines associated with Enasis Network Chatting Robie.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

async enrobie.plugins.nagios.ainswer.nagios_current(context: RunContext[AinswerDepends]) list[NagiosCurrentRecords][source]#

Return the current status for infratstructure in Nagios.

Note

This tool will return status values from Nagios Core. Nagios is a network and system monitoring platform.

Returns:

Current status for infratstructure in Nagios.

enrobie.plugins.nagios.current module#

Functions and routines associated with Enasis Network Chatting Robie.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enrobie.plugins.nagios.current.NagiosCurrent(plugin: NagiosPlugin)[source]#

Bases: object

Collect the information using the upstream API endpoint.

Parameters:

plugin – Plugin class instance for Chatting Robie.

property hosts: list[NagiosCurrentHost]#

Return the response from upstream API endpoint request.

Returns:

Response from upstream API endpoint request.

property records: NagiosCurrentRecords#

Return the response from upstream API endpoint request.

Returns:

Response from upstream API endpoint request.

request(item: Literal['host', 'service']) Response[source]#

Return the response from upstream API endpoint request.

Parameters:

item – Determine which items will be enumerated.

Returns:

Response from upstream API endpoint request.

property services: list[NagiosCurrentService]#

Return the response from upstream API endpoint request.

Returns:

Response from upstream API endpoint request.

property summary: NagiosCurrentSummary#

Return the response from upstream API endpoint request.

Returns:

Response from upstream API endpoint request.

class enrobie.plugins.nagios.current.NagiosCurrentHost(*, name: Annotated[str, MinLen(min_length=1)], status: Annotated[str, MinLen(min_length=1)], latest: Annotated[str, MinLen(min_length=1)], downtime: bool, handled: bool)[source]#

Bases: NagiosCurrentObject

Information regarding the item within Nagios monitoring.

model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class enrobie.plugins.nagios.current.NagiosCurrentObject(*, name: Annotated[str, MinLen(min_length=1)], status: Annotated[str, MinLen(min_length=1)], latest: Annotated[str, MinLen(min_length=1)], downtime: bool, handled: bool)[source]#

Bases: BaseModel

Information regarding the item within Nagios monitoring.

downtime: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Whether in scheduled downtime')]#
handled: Annotated[bool, FieldInfo(annotation=NoneType, required=True, description='Whether or not if was handled')]#
latest: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='When the latest event occurred', metadata=[MinLen(min_length=1)])]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Name of the object in Nagios', metadata=[MinLen(min_length=1)])]#
status: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Current status for the object', metadata=[MinLen(min_length=1)])]#
class enrobie.plugins.nagios.current.NagiosCurrentRecords(*, hosts: list[NagiosCurrentHost], services: list[NagiosCurrentService])[source]#

Bases: BaseModel

Summarized information regarding the items within Nagios.

hosts: Annotated[list[NagiosCurrentHost], FieldInfo(annotation=NoneType, required=True, description='System related status values')]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

services: Annotated[list[NagiosCurrentService], FieldInfo(annotation=NoneType, required=True, description='Service related status values')]#
class enrobie.plugins.nagios.current.NagiosCurrentService(*, name: Annotated[str, MinLen(min_length=1)], status: Annotated[str, MinLen(min_length=1)], latest: Annotated[str, MinLen(min_length=1)], downtime: bool, handled: bool, host: Annotated[str, MinLen(min_length=1)])[source]#

Bases: NagiosCurrentObject

Information regarding the item within Nagios monitoring.

host: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Host the service is related to', metadata=[MinLen(min_length=1)])]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class enrobie.plugins.nagios.current.NagiosCurrentSummary(*, service_normal: Annotated[int, Ge(ge=0)], service_issues: Annotated[int, Ge(ge=0)], host_normal: Annotated[int, Ge(ge=0)], host_issues: Annotated[int, Ge(ge=0)])[source]#

Bases: BaseModel

Summarized information regarding the items within Nagios.

host_issues: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Object count in issue state', metadata=[Ge(ge=0)])]#
host_normal: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Object count in normal state', metadata=[Ge(ge=0)])]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

service_issues: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Object count in issue state', metadata=[Ge(ge=0)])]#
service_normal: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Object count in normal state', metadata=[Ge(ge=0)])]#

enrobie.plugins.nagios.helpers module#

Functions and routines associated with Enasis Network Chatting Robie.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

enrobie.plugins.nagios.helpers.composedsc(plugin: NagiosPlugin, mitem: RobieMessage) None[source]#

Construct and format message for related chat platform.

Parameters:
  • plugin – Plugin class instance for Chatting Robie.

  • mitem – Item containing information for operation.

enrobie.plugins.nagios.helpers.composeirc(plugin: NagiosPlugin, mitem: RobieMessage) None[source]#

Construct and format message for related chat platform.

Parameters:
  • plugin – Plugin class instance for Chatting Robie.

  • mitem – Item containing information for operation.

enrobie.plugins.nagios.helpers.composemtm(plugin: NagiosPlugin, mitem: RobieMessage) None[source]#

Construct and format message for related chat platform.

Parameters:
  • plugin – Plugin class instance for Chatting Robie.

  • mitem – Item containing information for operation.

enrobie.plugins.nagios.params module#

Functions and routines associated with Enasis Network Chatting Robie.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enrobie.plugins.nagios.params.NagiosPluginCommandParams(*, irc: Annotated[str, MinLen(min_length=2)] = '!nagios', dsc: Annotated[str, MinLen(min_length=2)] = '!nagios', mtm: Annotated[str, MinLen(min_length=2)] = '!nagios')[source]#

Bases: RobieParamsModel

Process and validate the Robie configuration parameters.

dsc: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!nagios', description='Command name for chat platform', metadata=[MinLen(min_length=2)])]#
irc: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!nagios', description='Command name for chat platform', metadata=[MinLen(min_length=2)])]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

mtm: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!nagios', description='Command name for chat platform', metadata=[MinLen(min_length=2)])]#
class enrobie.plugins.nagios.params.NagiosPluginParams(_parse: ~typing.Callable[[...], ~typing.Any] | None = None, *, enable: bool = False, locate: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, trusted: ~typing.Annotated[list[str] | None, ~annotated_types.MinLen(min_length=1)] = None, command: ~enrobie.plugins.nagios.params.NagiosPluginCommandParams = <factory>, restful: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], username: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, password: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, timeout: ~typing.Annotated[int, ~annotated_types.Ge(ge=1), ~annotated_types.Le(le=300)] = 30, ssl_verify: bool = True, ssl_capem: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, clients: ~typing.Annotated[list[str], ~annotated_types.MinLen(min_length=1)], status: ~enrobie.plugins.status.params.StatusPluginIconParams = <factory>)[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])]#
command: Annotated[NagiosPluginCommandParams, FieldInfo(annotation=NoneType, required=False, default_factory=NagiosPluginCommandParams, description='Command name per chat platform')]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#
restful: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Where to find the RESTful API', examples=['http://localhost:8420'], metadata=[MinLen(min_length=1)])]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])]#
ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
username: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#

enrobie.plugins.nagios.plugin module#

Functions and routines associated with Enasis Network Chatting Robie.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enrobie.plugins.nagios.plugin.NagiosPlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin allows for connecting to Nagios Console.

ainswer() list[Callable[[...], Any]][source]#

Return the Ainswer tools that are related to the plugin.

Returns:

Ainswer tools that are related to the plugin.

property current: NagiosCurrent#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service threads.

Parameters:

thread – Child class instance for Chatting Robie.

property params: NagiosPluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

classmethod schema() Type[NagiosPluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

validate() None[source]#

Perform advanced validation on the parameters provided.

Module contents#

Functions and routines associated with Enasis Network Chatting Robie.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enrobie.plugins.nagios.NagiosPlugin(robie: Robie, name: str, params: RobieChildParams)[source]#

Bases: RobiePlugin

Integrate with the Robie routine and perform operations.

Note

This plugin allows for connecting to Nagios Console.

ainswer() list[Callable[[...], Any]][source]#

Return the Ainswer tools that are related to the plugin.

Returns:

Ainswer tools that are related to the plugin.

property current: NagiosCurrent#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

operate() None[source]#

Perform the operation related to Robie service threads.

Parameters:

thread – Child class instance for Chatting Robie.

property params: NagiosPluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

classmethod schema() Type[NagiosPluginParams][source]#

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

validate() None[source]#

Perform advanced validation on the parameters provided.

class enrobie.plugins.nagios.NagiosPluginParams(_parse: ~typing.Callable[[...], ~typing.Any] | None = None, *, enable: bool = False, locate: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, trusted: ~typing.Annotated[list[str] | None, ~annotated_types.MinLen(min_length=1)] = None, command: ~enrobie.plugins.nagios.params.NagiosPluginCommandParams = <factory>, restful: ~typing.Annotated[str, ~annotated_types.MinLen(min_length=1)], username: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, password: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, timeout: ~typing.Annotated[int, ~annotated_types.Ge(ge=1), ~annotated_types.Le(le=300)] = 30, ssl_verify: bool = True, ssl_capem: ~typing.Annotated[str | None, ~annotated_types.MinLen(min_length=1)] = None, clients: ~typing.Annotated[list[str], ~annotated_types.MinLen(min_length=1)], status: ~enrobie.plugins.status.params.StatusPluginIconParams = <factory>)[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

clients: Annotated[list[str], FieldInfo(annotation=NoneType, required=True, description='List of clients to enable plugin', metadata=[MinLen(min_length=1)])]#
command: Annotated[NagiosPluginCommandParams, FieldInfo(annotation=NoneType, required=False, default_factory=NagiosPluginCommandParams, description='Command name per chat platform')]#
model_config = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

password: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#
restful: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Where to find the RESTful API', examples=['http://localhost:8420'], metadata=[MinLen(min_length=1)])]#
ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])]#
ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')]#
status: Annotated[StatusPluginIconParams, FieldInfo(annotation=NoneType, required=False, default_factory=StatusPluginIconParams, description='Icon used per chat platform')]#
timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
username: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Authenticate with the service', metadata=[MinLen(min_length=1)])]#