You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after multiple reading of the tutorial I still dont understand the logic :/
Am I on the right way? :)
import nagiosplugin
class Check_A(nagiosplugin.Resource):
def probe(self):
a = 1
return [nagiosplugin.Metric('a', a, context='a')]
class Check_A(nagiosplugin.Context):
def evaluate(self):
if a == 1:
return nagiosplugin.Result(nagiosplugin.Ok, 'a is 1', context='a')
if a == 2:
return nagiosplugin.Result(nagiosplugin.Critical, 'a is 2', context='a')
@nagiosplugin.guarded
def main():
check = nagiosplugin.Check(
Check_A(),
nagiosplugin.Context('a')
)
check.main()
if __name__ == '__main__':
main()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi
after multiple reading of the tutorial I still dont understand the logic :/
Am I on the right way? :)
Beta Was this translation helpful? Give feedback.
All reactions