{"id":25799955,"url":"https://github.com/redmooner/ceserv","last_synced_at":"2026-05-15T09:14:58.179Z","repository":{"id":232781628,"uuid":"785187137","full_name":"RedMooner/CEServ","owner":"RedMooner","description":"CommandExecutor Server (Server) is a server application capable of accepting commands via GET requests and executing them for the user. After executing the command, the server returns the appropriate response.","archived":false,"fork":false,"pushed_at":"2024-04-11T11:40:50.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-11T12:34:23.612Z","etag":null,"topics":["api-server","automation","command-execution","command-executor","flask","python","rest-api","server-application","server-management","web-server","zabbix"],"latest_commit_sha":null,"homepage":"","language":"Python","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/RedMooner.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-11T11:28:03.000Z","updated_at":"2024-04-11T12:34:25.174Z","dependencies_parsed_at":"2024-04-11T12:44:27.977Z","dependency_job_id":null,"html_url":"https://github.com/RedMooner/CEServ","commit_stats":null,"previous_names":["redmooner/ceserv"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMooner%2FCEServ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMooner%2FCEServ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMooner%2FCEServ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedMooner%2FCEServ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedMooner","download_url":"https://codeload.github.com/RedMooner/CEServ/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241032129,"owners_count":19897434,"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":["api-server","automation","command-execution","command-executor","flask","python","rest-api","server-application","server-management","web-server","zabbix"],"created_at":"2025-02-27T15:57:59.786Z","updated_at":"2026-05-15T09:14:53.140Z","avatar_url":"https://github.com/RedMooner.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CEServ\nCommand Executor server\n# The server executing the commands\n## Description of the CommandExecutor Server\n\nCommandExecutor Server (Server) is a server application capable of accepting commands via GET requests and executing them for the user. After executing the command, the server returns the appropriate response.\n\n#### Features:\n- Accepts commands in the format of GET requests\n- Executes commands on a physical server\n- Sends responses after completing the command execution\n- Can be customized for various tasks and functionality\n\n#### Usage example:\n1. Send a GET request to the server with the command to be executed\n2. The server will execute the command on the physical server\n3. After completion of the execution, the server will send a response with the result of the command\n\nCEServ provides a convenient and flexible system for executing commands and receiving responses, which makes it a universal tool for automating and managing tasks on the server.\n\n\n# Introduction\n\nIt happens that there is a need to execute a command on the server and send its result somewhere else.\n\nTo solve such a problem, a simple solution was implemented, which will be shown below.\n\n## Zabbix\n\nThere is a Zabbix server, and it is possible to execute JavaScript code on network nodes. Our task was to get the exhaust of a certain command on the server and send the result to the Zabbix client for subsequent processing.\n\n# Solving the problem\n\nLet's write a simple server on flask that will process requests and execute commands on a physical server.\n\n```python\nfrom flask import Flask, request\nimport subprocess\n\napp = Flask(__name__)\n\n@app.route('/')\ndef index():\n    command = request.args.get('command')\n\n    if command:\n        try:\n            result = subprocess.check_output(command, shell=True)\n            print(result)\n            return result\n        except Exception as e:\n            return str(e)\n    \n    return 'No command provided.'\n\nif __name__ == '__main__':\n    app.run(port=\"5001\",host=\"127.0.0.1\",debug=True)\n```\n\nIn order to interact with the server using the java script language, you can use the following code:\n\n```jsx\nvar request = new HttpRequest();\nreturn request.get(\"command_text\", (value));\n```\n\nThe result will be the execution of the command on the server and the transfer of the result of the command execution to the client.\n\n# TODO\n\n- Implement black and white lists of commands to ensure security;\n- Implement the server installer and configurator.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredmooner%2Fceserv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredmooner%2Fceserv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredmooner%2Fceserv/lists"}