{"id":20687058,"url":"https://github.com/jcsalterego/nagios-rb","last_synced_at":"2025-04-22T15:07:10.299Z","repository":{"id":56885057,"uuid":"816233","full_name":"jcsalterego/nagios-rb","owner":"jcsalterego","description":"Nagios-rb is a compact framework for writing Nagios plugins.","archived":false,"fork":false,"pushed_at":"2015-04-29T22:16:28.000Z","size":146,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-16T04:24:31.664Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcsalterego.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-08-04T04:38:21.000Z","updated_at":"2019-07-14T10:02:16.000Z","dependencies_parsed_at":"2022-08-20T13:00:06.416Z","dependency_job_id":null,"html_url":"https://github.com/jcsalterego/nagios-rb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcsalterego%2Fnagios-rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcsalterego%2Fnagios-rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcsalterego%2Fnagios-rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcsalterego%2Fnagios-rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcsalterego","download_url":"https://codeload.github.com/jcsalterego/nagios-rb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250264910,"owners_count":21402003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T22:55:37.613Z","updated_at":"2025-04-22T15:07:10.264Z","avatar_url":"https://github.com/jcsalterego.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"nagios-rb\n=========\n\nA compact framework for writing [Nagios](http://www.nagios.org/) plugins.\n\nQuick Start\n===========\n\nSubclass `Nagios::Plugin`, and define three methods:\n\n * **measure** - returns the measured value, and optionally sets `@stats` for later usage.\n\n * **critical** - for any given *n*, returns whether in critical state.\n\n * **warning** - for any given *n*, returns whether in warning state.\n\nOptional methods:\n\n * **critical_msg** - Message to be used during a critical state.\n\n * **warning_msg** - Message to be used during a warning state.\n\n * **ok_msg** - Message to be used during an OK state.\n\nExample Plugin\n==============\n\nIn this trivial example, the plugin always measures 2, which is below both the warning and critical thresholds.  If critical status is reached, the custom `critical_msg` method is called; otherwise, the fallback message is just the measured value.\n\n    require 'rubygems'\n    require 'nagios'\n\n    class FooPlugin \u003c Nagios::Plugin\n      def critical(n)\n        n \u003e 5\n      end\n    \n      def critical_msg(n)\n        \"OH NOES!!! THE VALUE IS #{n}\"\n      end\n    \n      def warning(n)\n        n \u003e 3\n      end\n    \n      def measure\n        2\n      end\n    end\n\n    FooPlugin.new.run!\n\nFuture Work\n===========\n\nLots.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcsalterego%2Fnagios-rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcsalterego%2Fnagios-rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcsalterego%2Fnagios-rb/lists"}