{"id":21612199,"url":"https://github.com/vlcty/check_usb","last_synced_at":"2025-03-18T16:26:34.618Z","repository":{"id":74267417,"uuid":"43057626","full_name":"vlcty/check_usb","owner":"vlcty","description":"Icinga check for new USB devices","archived":false,"fork":false,"pushed_at":"2015-09-24T09:57:50.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T13:05:51.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","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/vlcty.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":"2015-09-24T09:31:38.000Z","updated_at":"2015-09-24T09:55:41.000Z","dependencies_parsed_at":"2023-03-11T16:54:20.165Z","dependency_job_id":null,"html_url":"https://github.com/vlcty/check_usb","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlcty%2Fcheck_usb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlcty%2Fcheck_usb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlcty%2Fcheck_usb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlcty%2Fcheck_usb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vlcty","download_url":"https://codeload.github.com/vlcty/check_usb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244258427,"owners_count":20424381,"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-24T21:17:06.623Z","updated_at":"2025-03-18T16:26:34.600Z","avatar_url":"https://github.com/vlcty.png","language":"Perl","readme":"# USB overwatch for Icinga 2\n\n## What is it\n\nThis is a plugin for Icinga 2 to overwatch the USB bus for new USB devices\n\n## What it does\n\nIt's a dirty implementation to monitor USB activity on Linux servers. It fetches the last 10 lines of dmesg output and checks for newly discovered USB devices.\n\n## Differences from check_hw\n\nThis plugin is not intended to monitor specific USB devices or ports but the whole bus at once. I run a Tor exit relay on a 1U rack server and don't want any nasty stuff attached to the server without proper notification in advance, for example: USB Sticks, KVM devices and so on.\n\nI combined my setup with an EventCommand which turns off the Tor relay if the service goes into CRITICAL state.\n\n## How to install\n\n### Step 1: Fetch the script\n\nFetch the script and place it in your PluginDir-Folder on every server you want to monitor. That's usually `/usr/lib/nagios/plugins`.\n\nNote: This is an agent based check!\n\n### Step 2: Make it available for Icinga 2\n\n#### Step 2.1: Create a CheckCommand object\n\nNavigate on your Icinga 2 server to your config folder, e.g.: `/etc/icinga2/conf.d` and open the `commands.conf` file.\nPlace this piece of code at the end of the file:\n\n```\nobject CheckCommand \"usb-overwatch\" {\n        import \"plugin-check-command\"\n\n        command = [ PluginDir + \"/check_usb\" ]\n}\n```\n\n#### Step 2.2: Add check to a host\n\nTo add the check to a host use this snippet in a host configuration file:\n\n```\nobject Host \"mineralwasser\" {\n\t[...]\n}\n\nobject Service \"usb-activity\" {\n      import \"generic-service\"\n\n      host_name = \"minerwalwasser\"\n      display_name = \"USB Overwatch\"\n\n      check_command = \"usb-overwatch\"\n}\n```\n\nIf you want to add it to multiple hosts work with `apply`!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlcty%2Fcheck_usb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlcty%2Fcheck_usb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlcty%2Fcheck_usb/lists"}