{"id":20506701,"url":"https://github.com/al2klimov/check_linux_netdev","last_synced_at":"2025-04-13T21:22:41.540Z","repository":{"id":52412648,"uuid":"192186763","full_name":"Al2Klimov/check_linux_netdev","owner":"Al2Klimov","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-14T12:09:39.000Z","size":30,"stargazers_count":3,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T11:43:33.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Al2Klimov.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}},"created_at":"2019-06-16T12:10:45.000Z","updated_at":"2021-05-20T20:40:31.000Z","dependencies_parsed_at":"2022-09-09T01:42:17.354Z","dependency_job_id":null,"html_url":"https://github.com/Al2Klimov/check_linux_netdev","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al2Klimov%2Fcheck_linux_netdev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al2Klimov%2Fcheck_linux_netdev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al2Klimov%2Fcheck_linux_netdev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al2Klimov%2Fcheck_linux_netdev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Al2Klimov","download_url":"https://codeload.github.com/Al2Klimov/check_linux_netdev/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248783388,"owners_count":21160913,"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-15T19:58:57.654Z","updated_at":"2025-04-13T21:22:41.508Z","avatar_url":"https://github.com/Al2Klimov.png","language":"Go","readme":"## About\n\nThe check plugin **check\\_linux\\_netdev** monitors\na Linux system's network device statistics via `/proc/net/dev`.\n\n## Demonstration\n\n1. `$ docker run -itp 8080:80 grandmaster/check_linux_netdev`\n2. Open http://localhost:8080 and navigate to the (only) service\n\n## Usage\n\nThe [plug-and-play Linux binaries]\ntake some optional CLI arguments and no environment variables:\n\n```\n$ ./check_linux_netdev [-d DURATION] [-e INTERFACE ...] [INTERFACE:METRIC:THRESHOLD=RANGE ...]\n```\n\ncheck\\_linux\\_netdev measures not only e.g. the bytes\nevery network device received so far, but also the average B/s\nduring DURATION being e.g. 10s or 2m (default: 1m).\n\n**Yes, this plugin runs for one minute by default!**\n\n-e specifies a network device to ignore.\n\nINTERFACE specifies either one particular network device (e.g. \"eth0\")\nor a pattern (e.g. \"eth?\\*\") with the special characters\n\"?\" (matches one character) and \"*\" (matches zero or more characters).\n\nMETRIC specifies a field of a network device in `/proc/net/dev`:\n\n* \"rx:bytes\"\n* \"rx:packets\"\n* \"rx:errs\"\n* \"rx:drop\"\n* \"rx:fifo\"\n* \"rx:frame\"\n* \"rx:compressed\"\n* \"rx:multicast\"\n* \"tx:bytes\"\n* \"tx:packets\"\n* \"tx:errs\"\n* \"tx:drop\"\n* \"tx:fifo\"\n* \"tx:colls\"\n* \"tx:carrier\"\n* \"tx:compressed\"\n\nTHRESHOLD specifies a warning/critical threshold:\n\n* \"total:w\"\n* \"total:c\"\n* \"persec:w\"\n* \"persec:c\"\n\n\"total\" stands for the field value as-is,\n\"persec\" for the average raise per second.\n\"w\" stands for warning, \"c\" for critical.\n\nRANGE is a threshold range as specified by the [Nagio$ check plugin API],\ne.g. \"23\" or \"@~:-42.0\".\n\nI.e. to let this plugin warn once an ethernet NIC\nsends more than 1GB/s during 5 minutes:\n\n```\n$ ./check_linux_netdev -d 5m 'eth?*:tx:bytes:persec:w=1000000000' 'enp?*s?*:tx:bytes:persec:w=1000000000'\n```\n\n### Legal info\n\nTo print the legal info, execute the plugin in a terminal:\n\n```\n$ ./check_linux_netdev\n```\n\nIn this case the program will always terminate with exit status 3 (\"unknown\")\nwithout actually checking anything.\n\n### Testing\n\nIf you want to actually execute a check inside a terminal,\nyou have to connect the standard output of the plugin to anything\nother than a terminal – e.g. the standard input of another process:\n\n```\n$ ./check_linux_netdev |cat\n```\n\nIn this case the exit code is likely to be the cat's one.\nThis can be worked around like this:\n\n```\nbash $ set -o pipefail\nbash $ ./check_linux_netdev |cat\n```\n\n### Actual monitoring\n\nJust integrate the plugin into the monitoring tool of your choice\nlike any other check plugin. (Consult that tool's manual on how to do that.)\nIt should work with any monitoring tool\nsupporting the [Nagio$ check plugin API].\n\nThe only limitation: check\\_linux\\_netdev must be run on the host to be checked\n– either with an agent of your monitoring tool or by SSH.\nOtherwise it will check the host your monitoring tool runs on.\n\nAlso take care of the execution timeout as **this plugin runs\nfor one minute by default** and the check interval as e.g. [Icinga 2]\nseems to add the execution time to the check interval,\ni.e. if you want to check via Icinga 2 every minute for one minute,\nyour check interval should be 1s.\n\n#### Icinga 2\n\nThis repository ships the [check command definition]\nas well as a [service template] and [host example] for Icinga 2.\n\nThe service definition will work in both correctly set up [Icinga 2 clusters]\nand Icinga 2 instances not being part of any cluster\nas long as the [hosts] are named after the [endpoints].\n\n[plug-and-play Linux binaries]: https://github.com/Al2Klimov/check_linux_netdev/releases\n[Nagio$ check plugin API]: https://nagios-plugins.org/doc/guidelines.html#AEN78\n[check command definition]: ./icinga2/check_linux_netdev.conf\n[service template]: ./icinga2/check_linux_netdev-service.conf\n[host example]: ./icinga2/check_linux_netdev-host.conf\n[Icinga 2]: https://www.icinga.com/docs/icinga2/latest/doc/01-about/\n[Icinga 2 clusters]: https://www.icinga.com/docs/icinga2/latest/doc/06-distributed-monitoring/\n[hosts]: https://www.icinga.com/docs/icinga2/latest/doc/09-object-types/#host\n[endpoints]: https://www.icinga.com/docs/icinga2/latest/doc/09-object-types/#endpoint\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal2klimov%2Fcheck_linux_netdev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal2klimov%2Fcheck_linux_netdev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal2klimov%2Fcheck_linux_netdev/lists"}