{"id":21888676,"url":"https://github.com/swisscom/mcollective-cmd-agent","last_synced_at":"2025-10-08T21:30:17.755Z","repository":{"id":66460236,"uuid":"49051511","full_name":"swisscom/mcollective-cmd-agent","owner":"swisscom","description":"This is a fork of the puppetlabs shell agent with ruby 1.8.7 support and additional features. https://github.com/puppetlabs/mcollective-shell-agent","archived":false,"fork":false,"pushed_at":"2016-03-27T11:36:20.000Z","size":67,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":17,"default_branch":"master","last_synced_at":"2023-08-04T09:23:20.184Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swisscom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-05T08:07:52.000Z","updated_at":"2016-03-26T10:28:21.000Z","dependencies_parsed_at":"2023-02-24T01:16:02.900Z","dependency_job_id":null,"html_url":"https://github.com/swisscom/mcollective-cmd-agent","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swisscom%2Fmcollective-cmd-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swisscom%2Fmcollective-cmd-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swisscom%2Fmcollective-cmd-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swisscom%2Fmcollective-cmd-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swisscom","download_url":"https://codeload.github.com/swisscom/mcollective-cmd-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235759893,"owners_count":19041048,"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-28T11:16:35.969Z","updated_at":"2025-10-08T21:30:17.204Z","avatar_url":"https://github.com/swisscom.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!NOTE]\n\u003e DEPRECATED - no longer maintained!\n\n# Cmd agent\n\nThis is a fork of the puppetlabs shell agent with ruby 1.8.7 support and\nadditional features.\n\n[![Build Status](https://travis-ci.org/swisscom/mcollective-cmd-agent.png?branch=master)](https://travis-ci.org/swisscom/mcollective-cmd-agent)\n\nThe cmd agent allows you to start and manage shell commands via\nmcollective.\n\nIt allows the running of long-running processes with a mechanism to check in\non the output from these long-running processes, which is independent of the\nmcollective daemon process (the daemon can be restarted without interrupting\nthe processes)\n\nTo use this agent you need at least:\n\n* MCollective 2.2.4\n* For Ruby 1.8.7 support: 'posix-spawn' and 'uuid' gem\n\nPlease note: we do not recommend this agent as a way of building out your\nautomation, for that you're still better off writing your own tailored\n[agents][writing-agents] that fit your use case.  This agent is targeted\nat the ad-hoc needs that people occasionally have.\n\n[writing-agents]: http://docs.puppetlabs.com/mcollective/simplerpc/agents.html\n\n## Installation\n\nFollow the [basic plugin install guide][install guide], taking all\nthe code from lib and adding it to your MCollective $libdir\n\n[install guide]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/InstalingPlugins\n\n\n## Configuring the agent\n\nThe agent should work without any additional configuration, though there are\nsome options you can tune the mcollective server.cfg.\n\n### `plugin.cmd.state_directory`\n\nThis is where the state used to track processes will live.  By default this\nwill be /var/run/mcollective-cmd on Unix systems.\n\n```\nplugin.cmd.state_directory = /opt/run/mcollective-cmd\n```\n\n\n## Application usage\n\nThe `mco cmd` application has several subcommands to start and manage\nprocesses.\n\n### mco shell run\n\nRuns a command and reports back.  Use this for discrete short-living commands.\n\nFor long-running commands look at `start` or `run --tail`.\n\n```\n$ mco cmd run dir\n\n * [ ============================================================\u003e ] 2 / 2\n\nmaster:\nbin   dev  home  lib64       media  opt   root  selinux  srv  tmp  vagrant\nboot  etc  lib   lost+found  mnt    proc  sbin  src      sys  usr  var\n\nserver2008r2a:\n Volume in drive C has no label.\n Volume Serial Number is DADF-75F9\n\n Directory of C:\\\n\n09/22/2012  11:45 AM    \u003cSYMLINKD\u003e     manifests [\\\\vboxsrv\\manifests]\n09/22/2012  11:45 AM    \u003cSYMLINKD\u003e     modules [\\\\vboxsrv\\modules]\n07/13/2009  08:20 PM    \u003cDIR\u003e          PerfLogs\n09/22/2012  11:42 AM    \u003cDIR\u003e          Program Files\n03/27/2014  06:52 AM    \u003cDIR\u003e          Program Files (x86)\n07/03/2014  07:42 AM    \u003cSYMLINKD\u003e     src [\\\\vboxsrv\\C:_src]\n03/27/2014  06:39 AM    \u003cDIR\u003e          Users\n07/03/2014  07:42 AM    \u003cSYMLINKD\u003e     vagrant [\\\\vboxsrv\\vagrant]\n03/27/2014  06:41 AM    \u003cDIR\u003e          Windows\n               0 File(s)              0 bytes\n               9 Dir(s)  34,565,091,328 bytes free\n\n\nFinished processing 2 / 2 hosts in 221.28 ms\n```\n\n### mco cmd run --tail\n\nStarts a command, shows you the output from it, kills the command when you\ninterrupt with control-c, exits normally when the command exits.\n\n```\n$ mco cmd -I /master/ run --tail vmstat 1\n\n * [ ============================================================\u003e ] 1 / 1\n\nmaster stdout: procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----\nmaster stdout:  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st\nmaster stdout:  0  1 445812 120584   5808  37348   34   29    52    48   39   47  6  1 93  0  0\nmaster stdout:  1  0 445112 122692   5824  37332 2692    0  2692    84  911 2089 47  9 40  4  0\nmaster stdout:  1  0 444848 122576   5824  37344  288    0   288     0  773 1914 48  5 47  0  0\nmaster stdout:  0  0 444012 121320   5824  37348 1212    0  1212     0  823 1917 47  6 45  1  0\nmaster stdout:  0  0 443984 121204   5824  37372    0    0     0     0  797 1796 52  5 43  0  0\nmaster stdout:  0  0 438800 117244   5824  37360 3896    0  3896     0  910 2123 49  6 45  0  0\nmaster stdout:  1  0 438768 117136   5840  37368    0    0     0   136  811 1926 48  6 45  0  0\n^CAttempting to stopping cleanly, interrupt again to kill\nSending kill to master 6dad5cb9-57f7-46e0-bad7-07ab117369a5\n```\n\n\n### mco cmd start\n\nStarts a command in the background and tells you the id that has been assigned\nto it.  You can then use `mco cmd watch`, `mco shell kill`, `mco shell list`\nto monitor this process and observe its output\n\n```\n$ mco cmd -I /master/ start vmstat 1\n\n * [ ============================================================\u003e ] 1 / 1\n\nmaster: 0dd67fac-734f-4824-8b4d-03100d4f9d07\n\nFinished processing 1 / 1 hosts in 76.37 ms\n```\n\n\n### mco cmd watch\n\nShows you the output of a command you previously started with `mco cmd start`\n\n```\n$ mco cmd watch 0dd67fac-734f-4824-8b4d-03100d4f9d07\n\n * [ ============================================================\u003e ] 2 / 2\n\nmaster stdout: procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----\nmaster stdout:  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st\nmaster stdout:  2  0 431448 110704   8484  40644   34   29    52    48   40   47  6  1 93  0  0\n```\n\n### mco cmd list\n\nShow a list of running jobs.\n\n```\n$ mco cmd list -v\n\n * [ ============================================================\u003e ] 2 / 2\n\nmaster:\n    0dd67fac-734f-4824-8b4d-03100d4f9d07\n    1fd3961a-f48d-4119-b988-146b490a5ca3\n    d174e20b-9cdb-4c14-9f34-fd29995f30cb\n    ea809b20-3123-46b4-bf59-10ff7251ca9b\n\nFinished processing 2 / 2 hosts in 142.34 ms\n```\n\n### mco cmd kill\n\nKill a running job.\n\n```\n$ mco cmd kill 0dd67fac-734f-4824-8b4d-03100d4f9d07\n\n * [ ============================================================\u003e ] 2 / 2\n\n\nFinished processing 2 / 2 hosts in 170.17 ms\n```\n\n### mco cmd clean\n\nCleanup an old job\n\n```\n$ mco cmd clean 0dd67fac-734f-4824-8b4d-03100d4f9d07\n\n * [ ============================================================\u003e ] 2 / 2\n\n\nFinished processing 2 / 2 hosts in 110.23 ms\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswisscom%2Fmcollective-cmd-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswisscom%2Fmcollective-cmd-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswisscom%2Fmcollective-cmd-agent/lists"}