{"id":19414476,"url":"https://github.com/axsuul/cookbook-monit","last_synced_at":"2025-04-24T12:32:02.756Z","repository":{"id":4766500,"uuid":"5917370","full_name":"axsuul/cookbook-monit","owner":"axsuul","description":"Provides Chef recipes for installing Monit and its configurations","archived":false,"fork":false,"pushed_at":"2016-08-29T15:09:02.000Z","size":18,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2023-03-12T09:07:20.506Z","etag":null,"topics":["chef","chef-cookbook","monit"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axsuul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-22T22:09:06.000Z","updated_at":"2017-03-12T07:13:18.000Z","dependencies_parsed_at":"2022-09-21T00:42:15.708Z","dependency_job_id":null,"html_url":"https://github.com/axsuul/cookbook-monit","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axsuul%2Fcookbook-monit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axsuul%2Fcookbook-monit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axsuul%2Fcookbook-monit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axsuul%2Fcookbook-monit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axsuul","download_url":"https://codeload.github.com/axsuul/cookbook-monit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223954093,"owners_count":17231180,"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":["chef","chef-cookbook","monit"],"created_at":"2024-11-10T12:38:17.133Z","updated_at":"2024-11-10T12:38:17.723Z","avatar_url":"https://github.com/axsuul.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"cookbook-monit\n===========\n\nProvides a set of primitives for managing monit and monit configurations.\n\nRequirements\n============\n\nChef\n----\n\nTested on \n\n* `0.10.x`\n* `0.11.x`\n* `0.12.x`\n\nPlatform\n--------\n\nTested on\n\n* Ubuntu 11.04\n* Ubuntu 12.04\n* Ubuntu 14.04\n\nbut older and newer platforms should work just fine.\n\nInstallation\n============\n[Berkshelf](http://berkshelf.com/) is recommended to install this cookbook. In fact, it's recommended to install all your cookbooks! Within your `Berksfile`\n\n```ruby\ncookbook 'monit', git: 'https://github.com/axsuul/cookbook-monit'\n```\n\nRecipes\n=======\n\nSome monit configuration recipes have also been provided for some popular services.\n\ndefault\n-------\n\nInstalls monit as a service using the package manager and drops off a `monitrc` configuration file. Make sure to check out the default attributes file!\n\nUsage\n=====\n\nA `monit` resource is provided to easily manage monit configurations. Here's a simple example\n\n```ruby\nmonit \"postgresql\" do\n  pidfile \"/var/run/postgresql/9.1-main.pid\"\n  start \"/etc/init.d/postgresql start\"\n  stop \"/etc/init.d/postgresql stop\"\nend\n```\n\nDefault action is `:enable`. You can disable by doing\n\n```ruby\nmonit \"postgresql\" do\n    # ...\n    action :disable\nend\n```\n\nWhat happens if you want to run the process as a user? The `monit` resource provides a helper attribute `as` and will load that user's environment while running the `start` and `stop` commands.\n```ruby\nmonit \"sidekiq\" do\n  pidfile \"/app/pids/sidekiq.pid\"\n  start \"/app/bin/sidekiq --pidfile /app/pids/sidekiq.pid\"\n  as \"deployer\"\n  conditions [\n    \"if mem \u003e 256 MB for 1 cycles then restart\",\n    \"if cpu \u003e 90% for 5 cycles then restart\",\n    \"if 5 restarts within 5 cycles then timeout\"\n  ]\nend\n```\n\nYou still have the option to run the commands directly as the user (without environment) with `uid` and `gid`, although most likely you will want to use `as`.\n\n```ruby\nmonit \"sidekiq\" do\n  pidfile \"/app/pids/sidekiq.pid\"\n  uid \"deployer\"\n  gid \"admin\"\n  # ...\nend\n```\n\nNotice that in the above example, `stop` is not set. If `stop` is not set, the provider will use a `SIGTERM` to kill the pid in the `pidfile`.\n\n**No pidfile?**. No worries bro!\n\n```ruby\nmonit \"varnish\" do\n  matching \"varnishd\"\n  # ...\nend\n```\n\nContributing\n============\n\nI love pull requests!\n\nLicense\n=======\n\nAuthor:: James Hu (\u003chello@james.hu\u003e)\n\nCopyright:: Copyright (c) 2016, James Hu\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxsuul%2Fcookbook-monit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxsuul%2Fcookbook-monit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxsuul%2Fcookbook-monit/lists"}