check_pa.modules package

Submodules

check_pa.modules.certificate module

class check_pa.modules.certificate.Certificate(host, token, exclude)[source]

Bases: nagiosplugin.resource.Resource

Will fetch the certificates from the REST API and returns a warning if the remaining days of the certificate is between the value of warning (e. g. 20) and critical (e. g. 0).

If a certificate has been revoked or excluded, no warning will appear.

probe()[source]

Querys the REST-API and create certificate metrics.

Returns:a certificate metric.
class check_pa.modules.certificate.CertificateContext(name, r, fmt_metric='{name} expires in {valueunit}', result_cls=<class 'nagiosplugin.result.Result'>)[source]

Bases: nagiosplugin.context.Context

evaluate(metric, resource)[source]

Output depending on given start and end range.

Returns a warning, if a certificate is between given start and end range. Returns ok, if a certificate is out of range.

Parameters:
  • metric
  • resource
Returns:

class check_pa.modules.certificate.CertificateSummary(r)[source]

Bases: nagiosplugin.summary.Summary

ok(results)[source]
problem(results)[source]
check_pa.modules.certificate.create_check(args)[source]

Creates and configures a check for the certificate command.

Returns:the throughput check.
check_pa.modules.certificate.get_now()[source]

Extract method for mocking datetime.now.

Returns:datetime.today() object

check_pa.modules.diskspace module

class check_pa.modules.diskspace.DiskSpace(host, token)[source]

Bases: nagiosplugin.resource.Resource

Reads the used disk space of the Palo Alto Firewall System.

probe()[source]

Querys the REST-API and create disk space metrics.

Returns:a disk space metric.
class check_pa.modules.diskspace.DiskSpaceSummary[source]

Bases: nagiosplugin.summary.Summary

Create status line from results.

ok(results)[source]
problem(results)[source]
check_pa.modules.diskspace.create_check(args)[source]

Creates and configures a check for the diskspace command.

Returns:the diskspace check.

check_pa.modules.environmental module

class check_pa.modules.environmental.Environmental(host, token)[source]

Bases: nagiosplugin.resource.Resource

Reads the used disk space of the Palo Alto Firewall System.

probe()[source]

Querys the REST-API and create disk space metrics.

Returns:a disk space metric.
class check_pa.modules.environmental.EnvironmentalContext(name, fmt_metric='{name} is {valueunit}', result_cls=<class 'nagiosplugin.result.Result'>)[source]

Bases: nagiosplugin.context.Context

evaluate(metric, resource)[source]
class check_pa.modules.environmental.EnvironmentalSummary[source]

Bases: nagiosplugin.summary.Summary

ok(results)[source]
problem(results)[source]
check_pa.modules.environmental.create_check(args)[source]

Creates and configures a check for the environmental command.

Returns:the environmental check.

check_pa.modules.load module

class check_pa.modules.load.Load(host, token)[source]

Bases: nagiosplugin.resource.Resource

probe()[source]

Querys the REST-API and create load metrics.

Returns:a load metric.
class check_pa.modules.load.LoadSummary[source]

Bases: nagiosplugin.summary.Summary

ok(results)[source]
check_pa.modules.load.create_check(args)[source]

Creates and configures a check for the load command.

Returns:the load check.

check_pa.modules.sessioninfo module

class check_pa.modules.sessioninfo.SessInfo(host, token)[source]

Bases: nagiosplugin.resource.Resource

probe()[source]

Querys the REST-API and create session info metrics.

Returns:a sessioninfo metric.
class check_pa.modules.sessioninfo.SessSummary[source]

Bases: nagiosplugin.summary.Summary

ok(results)[source]
check_pa.modules.sessioninfo.create_check(args)[source]

Creates and configures a check for the sessioninfo command.

Returns:the sessioninfo check.

check_pa.modules.thermal module

class check_pa.modules.thermal.Thermal(host, token)[source]

Bases: nagiosplugin.resource.Resource

probe()[source]

Querys the REST-API and create thermal metrics.

Returns:a disk space metric.
class check_pa.modules.thermal.ThermalSummary[source]

Bases: nagiosplugin.summary.Summary

ok(results)[source]
problem(results)[source]

Prints a more informative output

Parameters:results – Results container
Returns:status line
check_pa.modules.thermal.create_check(args)[source]

Creates and configures a check for the thermal command.

Returns:the thermal check.

check_pa.modules.throughput module

class check_pa.modules.throughput.NetworkSummary[source]

Bases: nagiosplugin.summary.Summary

Creates a throughput summary.

ok(results)[source]
class check_pa.modules.throughput.Throughput(host, token, interface_name)[source]

Bases: nagiosplugin.resource.Resource

A throughput resource.

probe()[source]

Querys the REST-API and create throughput metrics.

Returns:a throughput metric.
check_pa.modules.throughput.create_check(args)[source]

Creates and configures a check for the throughput command.

Returns:the throughput check.
check_pa.modules.throughput.get_statefile_path()[source]
check_pa.modules.throughput.get_time()[source]

Extract method for mocking time.

Returns:time.time() object
check_pa.modules.throughput.reset()[source]

Removes the throughput file.

check_pa.modules.useragent module

class check_pa.modules.useragent.UserAgent(host, token)[source]

Bases: nagiosplugin.resource.Resource

probe()[source]

Querys the REST-API and create user agent metrics.

Returns:a user agent metric.
class check_pa.modules.useragent.UserAgentContext(name, fmt_metric='{name} is {valueunit}', result_cls=<class 'nagiosplugin.result.Result'>)[source]

Bases: nagiosplugin.context.Context

evaluate(metric, resource)[source]
class check_pa.modules.useragent.UserAgentSummary[source]

Bases: nagiosplugin.summary.Summary

ok(results)[source]
problem(results)[source]
check_pa.modules.useragent.create_check(args)[source]

Creates and configures a check for the useragent command.

Returns:the useragent check.

Module contents