{"id":40877602,"url":"https://github.com/ozzi-/check_snmp","last_synced_at":"2026-01-22T01:06:52.281Z","repository":{"id":88380597,"uuid":"170470944","full_name":"ozzi-/check_snmp","owner":"ozzi-","description":"icinga 2 monitoring script for snmp with regex support","archived":false,"fork":false,"pushed_at":"2024-01-19T06:48:13.000Z","size":32,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-22T11:43:44.349Z","etag":null,"topics":["icinga","icinga2","monitoring","performance","script","snmp"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ozzi-.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-02-13T08:35:30.000Z","updated_at":"2024-01-19T06:46:35.000Z","dependencies_parsed_at":"2024-01-19T08:46:48.598Z","dependency_job_id":"12cf240f-a621-4745-a5d2-b2ae01a01698","html_url":"https://github.com/ozzi-/check_snmp","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ozzi-/check_snmp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozzi-%2Fcheck_snmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozzi-%2Fcheck_snmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozzi-%2Fcheck_snmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozzi-%2Fcheck_snmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ozzi-","download_url":"https://codeload.github.com/ozzi-/check_snmp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozzi-%2Fcheck_snmp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["icinga","icinga2","monitoring","performance","script","snmp"],"created_at":"2026-01-22T01:06:51.524Z","updated_at":"2026-01-22T01:06:52.265Z","avatar_url":"https://github.com/ozzi-.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# check_snmp\nProvides SNMP checks using warning / critical limits for integer results or regexes.\nSupports performance data.\n\n## Script\n```\n  Usage: check_snmp [OPTIONS]\n  [OPTIONS]\n\n  -p PORT            Port to send the snmp request to (default: 161)\n  -N COMMUNITY       SNMP community name (default: public)\n  -H HOST            Hostname to send SNMP queries to\n  -o OID             SNMP OID to query\n  -V VERSION         SNMP Version (default: 2)\n  -M MORE            When using -V 3, pass all required snmpget parameters\n                     with -M, i.E. \"-u user -a MD5 -A 72d0815....D38 -x AES\"\n\n  -w WARNING         Defines limit for WARNING\n  -c CRITICAL        Defines limit for CRITICAL\n\n  -W WARNING REGEX   If regex matches WARNING will be returned\n  -C CRITICAL REGEX  If regex matches CRITICAL will be returned\n \n```\nNotes: \n- You can either set limits (-w \u0026 -c) OR regexes (-W \u0026 -C)\n- Setting limits and regexes, regexes will be used\n- When using regexes, the performance data won't include warning / critical limits\n- When setting a warning limit that is smaller than the critical limit, a GREATER THAN will be used to evaluate the result\n- When setting a critical limit that is smaller than the warning limit, a LESS THAN will be used to evaluate the result\n\nExample usage of the script:\n```\n# (1) If result is bigger than 4, return warning, bigger than 7, return critical\n./check_snmp.sh -H 192.168.200.101 -o iso.3.6.1.2.1.25.4.2.1.6.11391 -w 4 -c 7\nCRITICAL: '5' is bigger than warning limit '$critical'\n\n# (2) If result is smaller than 4, return warning, smaller than 2, return critical (since -w \u003e -c)\n./check_snmp.sh -H 192.168.200.101 -o iso.3.6.1.2.1.25.4.2.1.6.11391 -w 4 -c 2\nCRITICAL: '5' is bigger than warning limit '$critical'\n\n# (3) If result is between 1-3, return warning, between 4-99 return critical\n./check_snmp.sh -H 192.168.200.101 -o iso.3.6.1.2.1.25.4.2.1.6.11391 -W [1-3] -C [4-99]\nWARNING: Result value '2' matches warning regex '[1-3]'\n\n# (4) If result string is a Pentium CPU, return warning, if a Xeon CPU, return critical\n./check_snmp.sh -H 192.168.200.101 -o iso.3.6.1.2.1.25.3.2.1.3.1 -l \"Pentium\" -h \"Intel.*Xeon.*\"\nCRITICAL: Result value 'Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz' matches critical regex 'Intel.*Xeon.*'\n\n# (5) SNMPv3, see -M providing multiple command line arguments passed straight on\n./check_snmp.sh -H 192.168.200.102 -o so.3.6.1.2.1.25.4.2.1.6.11391 -V 3 -w 4 -c 7 -M \"-u user -a MD5 -A 72...D38 -x AES\"\n\n```\n\n## Icinga 2\nUsage in your hosts file:\n```\n# (1)\nobject Host \"mailserver.local\" {\n  check_command = \"check-snmp\"\n  address = \"192.168.200.101\"\n  vars.csnmp_oid = \"iso.3.6.1.2.1.25.4.2.1.6.11391\"\n  vars.csnmp_warning = \"4\"\n  vars.csnmp_critical = \"7\"\n}\n# (3)\nobject Host \"mailserver.local\" {\n  check_command = \"check-snmp\"\n  address = \"192.168.200.101\"\n  vars.csnmp_oid = \"iso.3.6.1.2.1.25.4.2.1.6.11391\"\n  vars.csnmp_community = \"communityname\"\n  vars.csnmp_port = 1234\n  vars.csnmp_warning_regex = \"[1-3]\"\n  vars.csnmp_critical_regex = \"[4-99]\"\n}\n```\nSee the provided commands.conf for the Icinga command definition of \"check-snmp\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozzi-%2Fcheck_snmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fozzi-%2Fcheck_snmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozzi-%2Fcheck_snmp/lists"}