enrobie.plugins.nagios package#

Submodules#

enrobie.plugins.nagios.ainswer module#

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#

class enrobie.plugins.nagios.current.NagiosCurrentObject[source]#

Bases: BaseModel

Information regarding the item within Nagios monitoring.

Fields#

Field

Type

Required

Default

Constraints

downtime

bool

Yes

handled

bool

Yes

latest

str

Yes

min_length=1

name

str

Yes

min_length=1

status

str

Yes

min_length=1

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)])]#
latest: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='When the latest event occurred', metadata=[MinLen(min_length=1)])]#
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')]#
class enrobie.plugins.nagios.current.NagiosCurrentHost[source]#

Bases: NagiosCurrentObject

Information regarding the item within Nagios monitoring.

Fields#

Field

Type

Required

Default

Constraints

downtime

bool

Yes

handled

bool

Yes

latest

str

Yes

min_length=1

name

str

Yes

min_length=1

status

str

Yes

min_length=1

class enrobie.plugins.nagios.current.NagiosCurrentService[source]#

Bases: NagiosCurrentObject

Information regarding the item within Nagios monitoring.

Fields#

Field

Type

Required

Default

Constraints

downtime

bool

Yes

handled

bool

Yes

host

str

Yes

min_length=1

latest

str

Yes

min_length=1

name

str

Yes

min_length=1

status

str

Yes

min_length=1

host: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Host the service is related to', metadata=[MinLen(min_length=1)])]#
class enrobie.plugins.nagios.current.NagiosCurrentRecords[source]#

Bases: BaseModel

Summarized information regarding the items within Nagios.

Fields#

Field

Type

Required

Default

hosts

list[NagiosCurrentHost]

Yes

services

list[NagiosCurrentService]

Yes

hosts: Annotated[list[NagiosCurrentHost], FieldInfo(annotation=NoneType, required=True, description='System related status values')]#
services: Annotated[list[NagiosCurrentService], FieldInfo(annotation=NoneType, required=True, description='Service related status values')]#
class enrobie.plugins.nagios.current.NagiosCurrentSummary[source]#

Bases: BaseModel

Summarized information regarding the items within Nagios.

Fields#

Field

Type

Required

Default

Constraints

host_issues

int

Yes

ge=0

host_normal

int

Yes

ge=0

service_issues

int

Yes

ge=0

service_normal

int

Yes

ge=0

service_normal: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Object count in normal state', metadata=[Ge(ge=0)])]#
service_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)])]#
host_issues: Annotated[int, FieldInfo(annotation=NoneType, required=True, description='Object count in issue state', metadata=[Ge(ge=0)])]#
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.

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 hosts: list[NagiosCurrentHost]#

Return the response from upstream API endpoint request.

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.

property records: NagiosCurrentRecords#

Return the response from upstream API endpoint request.

Returns:

Response from upstream API endpoint request.

enrobie.plugins.nagios.helpers module#

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#

class enrobie.plugins.nagios.params.NagiosPluginCommandParams[source]#

Bases: RobieParamsModel

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

dsc

str

No

'!nagios'

min_length=2

irc

str

No

'!nagios'

min_length=2

mtm

str

No

'!nagios'

min_length=2

irc: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!nagios', description='Command name for chat platform', metadata=[MinLen(min_length=2)])]#
dsc: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='!nagios', description='Command name for chat platform', metadata=[MinLen(min_length=2)])]#
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[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

clients

list[str]

Yes

min_length=1

command

NagiosPluginCommandParams

No

factory

enable

bool

No

False

locate

str | None

No

None

min_length=1

password

str | None

No

None

min_length=1

restful

str

Yes

min_length=1

ssl_capem

str | None

No

None

min_length=1

ssl_verify

bool

No

True

status

StatusPluginIconParams

No

factory

timeout

int

No

30

ge=1, le=300

trusted

list[str] | None

No

None

min_length=1

username

str | None

No

None

min_length=1

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

enrobie.plugins.nagios.plugin module#

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.

validate() None[source]#

Perform advanced validation on the parameters provided.

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

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: NagiosPluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

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.

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

Return the Ainswer tools that are related to the plugin.

Returns:

Ainswer tools that are related to the plugin.

Module contents#

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.

validate() None[source]#

Perform advanced validation on the parameters provided.

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

Return the configuration parameters relevant for class.

Returns:

Configuration parameters relevant for class.

property params: NagiosPluginParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

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.

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

Return the Ainswer tools that are related to the plugin.

Returns:

Ainswer tools that are related to the plugin.

class enrobie.plugins.nagios.NagiosPluginParams[source]#

Bases: RobiePluginParams

Process and validate the Robie configuration parameters.

Fields#

Field

Type

Required

Default

Constraints

clients

list[str]

Yes

min_length=1

command

NagiosPluginCommandParams

No

factory

enable

bool

No

False

locate

str | None

No

None

min_length=1

password

str | None

No

None

min_length=1

restful

str

Yes

min_length=1

ssl_capem

str | None

No

None

min_length=1

ssl_verify

bool

No

True

status

StatusPluginIconParams

No

factory

timeout

int

No

30

ge=1, le=300

trusted

list[str] | None

No

None

min_length=1

username

str | None

No

None

min_length=1

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