fix: [shells] Fixed/improved command line help

pull/7224/head
Matjaz Rihtar 2021-03-18 23:44:04 +01:00
parent 90ed58d567
commit 93b2355260
No known key found for this signature in database
GPG Key ID: 6A9BA77DB435F955
4 changed files with 188 additions and 116 deletions

View File

@ -9,6 +9,10 @@ class AdminShell extends AppShell
public function jobGenerateCorrelation()
{
$this->ConfigLoad->execute();
if (empty($this->args[0])) {
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Generate correlation'] . PHP_EOL);
}
$jobId = $this->args[0];
$this->loadModel('Job');
$this->Job->id = $jobId;
@ -22,6 +26,10 @@ class AdminShell extends AppShell
public function jobPurgeCorrelation()
{
$this->ConfigLoad->execute();
if (empty($this->args[0])) {
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Purge correlation'] . PHP_EOL);
}
$jobId = $this->args[0];
$this->loadModel('Job');
$this->Job->id = $jobId;
@ -35,6 +43,10 @@ class AdminShell extends AppShell
public function jobGenerateShadowAttributeCorrelation()
{
$this->ConfigLoad->execute();
if (empty($this->args[0])) {
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Generate shadow attribute correlation'] . PHP_EOL);
}
$jobId = $this->args[0];
$this->loadModel('Job');
$this->Job->id = $jobId;
@ -59,6 +71,10 @@ class AdminShell extends AppShell
public function updateAfterPull()
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1]) || empty($this->args[2])) {
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Update after pull'] . PHP_EOL);
}
$this->loadModel('Job');
$this->loadModel('Server');
$submodule_name = $this->args[0];
@ -79,8 +95,9 @@ class AdminShell extends AppShell
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || !is_numeric($this->args[0])) {
echo 'Usage: ' . APP . '/cake ' . 'Admin restartWorker [PID]' . PHP_EOL;
die('Usage: ' . $this->Server->command_line_functions['worker_management_tasks']['data']['Restart a worker'] . PHP_EOL);
}
$pid = $this->args[0];
$result = $this->Server->restartWorker($pid);
if ($result === true) {
@ -100,9 +117,9 @@ class AdminShell extends AppShell
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || !is_numeric($this->args[0])) {
echo 'Usage: ' . APP . '/cake ' . 'Admin killWorker [PID]' . PHP_EOL;
die();
die('Usage: ' . $this->Server->command_line_functions['worker_management_tasks']['data']['Kill a worker'] . PHP_EOL);
}
$pid = $this->args[0];
$result = $this->Server->killWorker($pid, false);
echo sprintf(
@ -117,9 +134,9 @@ class AdminShell extends AppShell
{
$this->ConfigLoad->execute();
if (empty($this->args[0])) {
echo 'Usage: ' . APP . '/cake ' . 'Admin startWorker [queue]' . PHP_EOL;
die();
die('Usage: ' . $this->Server->command_line_functions['worker_management_tasks']['data']['Start a worker'] . PHP_EOL);
}
$queue = $this->args[0];
$this->Server->startWorker($queue);
echo sprintf(
@ -206,38 +223,42 @@ class AdminShell extends AppShell
{
$this->ConfigLoad->execute();
if (empty($this->args[0])) {
echo 'Usage: ' . APP . '/cake ' . 'Admin updateObjectTemplates [user_id]' . PHP_EOL;
} else {
$userId = $this->args[0];
$user = $this->User->getAuthUser($userId);
# If the user_id passed does not exist, do a global update.
if (empty($user)) {
echo 'User with ID: ' . $userId . ' not found' . PHP_EOL;
$result = $this->ObjectTemplate->update();
} else {
$result = $this->ObjectTemplate->update($user, false,false);
}
$successes = count(!empty($result['success']) ? $result['success'] : []);
$fails = count(!empty($result['fails']) ? $result['fails'] : []);
$message = '';
if ($successes == 0 && $fails == 0) {
$message = __('All object templates are up to date already.');
} elseif ($successes == 0 && $fails > 0) {
$message = __('Could not update any of the object templates.');
} elseif ($successes > 0 ) {
$message = __('Successfully updated %s object templates.', $successes);
if ($fails != 0) {
$message .= __(' However, could not update %s object templates.', $fails);
}
}
echo $message . PHP_EOL;
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Update object templates'] . PHP_EOL);
}
$userId = $this->args[0];
$user = $this->User->getAuthUser($userId);
# If the user_id passed does not exist, do a global update.
if (empty($user)) {
echo 'User with ID: ' . $userId . ' not found' . PHP_EOL;
$result = $this->ObjectTemplate->update();
} else {
$result = $this->ObjectTemplate->update($user, false,false);
}
$successes = count(!empty($result['success']) ? $result['success'] : []);
$fails = count(!empty($result['fails']) ? $result['fails'] : []);
$message = '';
if ($successes == 0 && $fails == 0) {
$message = __('All object templates are up to date already.');
} elseif ($successes == 0 && $fails > 0) {
$message = __('Could not update any of the object templates.');
} elseif ($successes > 0 ) {
$message = __('Successfully updated %s object templates.', $successes);
if ($fails != 0) {
$message .= __(' However, could not update %s object templates.', $fails);
}
}
echo $message . PHP_EOL;
}
public function jobUpgrade24()
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1])) {
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Job upgrade'] . PHP_EOL);
}
$jobId = $this->args[0];
$user_id = $this->args[1];
$this->loadModel('Job');
@ -252,6 +273,10 @@ class AdminShell extends AppShell
public function prune_update_logs()
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1])) {
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Prune update logs'] . PHP_EOL);
}
$jobId = $this->args[0];
$user_id = $this->args[1];
$user = $this->User->getAuthUser($user_id);
@ -317,38 +342,38 @@ class AdminShell extends AppShell
if ($value === 'true') $value = 1;
$cli_user = array('id' => 0, 'email' => 'SYSTEM', 'Organisation' => array('name' => 'SYSTEM'));
if (empty($setting_name) || $value === null) {
echo 'Invalid parameters. Usage: ' . APP . 'Console/cake Admin setSetting [setting_name] [setting_value]' . PHP_EOL;
} else {
$setting = $this->Server->getSettingData($setting_name);
if (empty($setting)) {
echo 'Invalid setting "' . $setting_name . '". Please make sure that the setting that you are attempting to change exists and if a module parameter, the modules are running.' . PHP_EOL;
exit(1);
}
$result = $this->Server->serverSettingsEditValue($cli_user, $setting, $value);
if ($result === true) {
echo 'Setting "' . $setting_name . '" changed to ' . $value . PHP_EOL;
} else {
echo $result;
}
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Set setting'] . PHP_EOL);
}
$setting = $this->Server->getSettingData($setting_name);
if (empty($setting)) {
echo 'Invalid setting "' . $setting_name . '". Please make sure that the setting that you are attempting to change exists and if a module parameter, the modules are running.' . PHP_EOL;
exit(1);
}
$result = $this->Server->serverSettingsEditValue($cli_user, $setting, $value);
if ($result === true) {
echo 'Setting "' . $setting_name . '" changed to ' . $value . PHP_EOL;
} else {
echo $result . PHP_EOL;
}
echo PHP_EOL;
}
public function setDatabaseVersion()
{
$this->ConfigLoad->execute();
if (empty($this->args[0])) echo 'Invalid parameters. Usage: ' . APP . 'Console/cake Admin setDatabaseVersion [db_version]' . PHP_EOL;
else {
$db_version = $this->AdminSetting->find('first', array(
'conditions' => array('setting' => 'db_version')
));
if (!empty($db_version)) {
$db_version['AdminSetting']['value'] = trim($this->args[0]);
$this->AdminSetting->save($db_version);
echo 'Database version set. MISP will replay all of the upgrade scripts since the selected version on the next user login.' . PHP_EOL;
} else {
echo 'Something went wrong. Could not find the existing db version.' . PHP_EOL;
}
if (empty($this->args[0])) {
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Set database version'] . PHP_EOL);
}
$db_version = $this->AdminSetting->find('first', array(
'conditions' => array('setting' => 'db_version')
));
if (!empty($db_version)) {
$db_version['AdminSetting']['value'] = trim($this->args[0]);
$this->AdminSetting->save($db_version);
echo 'Database version set. MISP will replay all of the upgrade scripts since the selected version on the next user login.' . PHP_EOL;
} else {
echo 'Something went wrong. Could not find the existing db version.' . PHP_EOL;
}
}
@ -371,18 +396,18 @@ class AdminShell extends AppShell
{
$this->ConfigLoad->execute();
if (empty($this->args[0])) {
echo 'Invalid parameters. Usage: ' . APP . 'Console/cake Admin getAuthkey [user_email]' . PHP_EOL;
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Get authkey'] . PHP_EOL);
}
$user = $this->User->find('first', array(
'recursive' => -1,
'conditions' => array('User.email' => strtolower($this->args[0])),
'fields' => array('User.authkey')
));
if (empty($user)) {
echo 'Invalid user.' . PHP_EOL;
} else {
$user = $this->User->find('first', array(
'recursive' => -1,
'conditions' => array('User.email' => strtolower($this->args[0])),
'fields' => array('User.authkey')
));
if (empty($user)) {
echo 'Invalid user.' . PHP_EOL;
} else {
echo $user['User']['authkey'] . PHP_EOL;
}
echo $user['User']['authkey'] . PHP_EOL;
}
}
@ -414,18 +439,18 @@ class AdminShell extends AppShell
}
$roles = implode(PHP_EOL, $roles);
echo "Roles:\n" . $roles . $this->separator();
echo 'Usage: ' . APP . 'cake ' . 'Admin setDefaultRole [role_id]' . PHP_EOL;
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Set default role'] . PHP_EOL);
}
$role = $this->Role->find('first', array(
'recursive' => -1,
'conditions' => array('Role.id' => $this->args[0])
));
if (!empty($role)) {
$result = $this->AdminSetting->changeSetting('default_role', $role['Role']['id']);
echo 'Default Role updated to ' . escapeshellcmd($role['Role']['name']) . PHP_EOL;
} else {
$role = $this->Role->find('first', array(
'recursive' => -1,
'conditions' => array('Role.id' => $this->args[0])
));
if (!empty($role)) {
$result = $this->AdminSetting->changeSetting('default_role', $role['Role']['id']);
echo 'Default Role updated to ' . escapeshellcmd($role['Role']['name']) . PHP_EOL;
} else {
echo 'Something went wrong, invalid Role.' . PHP_EOL;
}
echo 'Something went wrong, invalid Role.' . PHP_EOL;
}
}
@ -441,6 +466,7 @@ class AdminShell extends AppShell
echo 'MISP apikey command line tool.' . PHP_EOL . 'To assign a new random API key for a user: ' . APP . 'Console/cake change_authkey [email]' . PHP_EOL . 'To assign a fixed API key: ' . APP . 'Console/cake change_authkey [email] [authkey]' . PHP_EOL;
die();
}
if (!empty($this->args[1])) {
$authKey = $this->args[1];
} else {
@ -535,22 +561,22 @@ class AdminShell extends AppShell
APP
);
die();
} else {
$userId = $this->args[0];
$user = $this->User->getAuthUser($userId);
if (empty($user)) {
echo __('Invalid user.') . "\n\n";
}
if (!$user['Role']['perm_site_admin']) {
echo __('User has to be a site admin.') . "\n\n";
}
if (!empty($this->args[1])) {
$jobId = $this->args[1];
} else {
$jobId = false;
}
$this->User->resetAllSyncAuthKeys($user, $jobId);
}
$userId = $this->args[0];
$user = $this->User->getAuthUser($userId);
if (empty($user)) {
echo __('Invalid user.') . "\n\n";
}
if (!$user['Role']['perm_site_admin']) {
echo __('User has to be a site admin.') . "\n\n";
}
if (!empty($this->args[1])) {
$jobId = $this->args[1];
} else {
$jobId = false;
}
$this->User->resetAllSyncAuthKeys($user, $jobId);
}
public function purgeFeedEvents()
@ -560,16 +586,16 @@ class AdminShell extends AppShell
(empty($this->args[0]) || !is_numeric($this->args[0])) ||
(empty($this->args[1]) || !is_numeric($this->args[1]))
) {
echo 'Usage: ' . APP . '/cake ' . 'Admin purgeFeedEvents [user_id] [feed_id]' . PHP_EOL;
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Purge feed events'] . PHP_EOL);
}
$user_id = $this->args[0];
$feed_id = $this->args[1];
$result = $this->Feed->cleanupFeedEvents($user_id, $feed_id);
if (is_string($result)) {
echo __("\nError: %s\n", $result);
} else {
$user_id = $this->args[0];
$feed_id = $this->args[1];
$result = $this->Feed->cleanupFeedEvents($user_id, $feed_id);
if (is_string($result)) {
echo __("\nError: %s\n", $result);
} else {
echo __("%s events purged.\n", $result);
}
echo __("%s events purged.\n", $result);
}
}
@ -601,8 +627,8 @@ class AdminShell extends AppShell
$this->ConfigLoad->execute();
if (empty($this->args[0])) {
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Get IPs for user ID'] . PHP_EOL);
die();
}
$user_id = trim($this->args[0]);
$redis = $this->Server->setupRedis();
$user = $this->User->find('first', array(
@ -626,8 +652,8 @@ class AdminShell extends AppShell
$this->ConfigLoad->execute();
if (empty($this->args[0])) {
die('Usage: ' . $this->Server->command_line_functions['console_admin_tasks']['data']['Get user ID for user IP'] . PHP_EOL);
die();
}
$ip = trim($this->args[0]);
$redis = $this->Server->setupRedis();
$user_id = $redis->get('misp:ip_user:' . $ip);

View File

@ -365,8 +365,9 @@ class EventShell extends AppShell
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1]) || empty($this->args[2])) {
die('Usage: ' . $this->Server->command_line_functions['enrichment'] . PHP_EOL);
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['Run enrichment'] . PHP_EOL);
}
$userId = $this->args[0];
$user = $this->getUser($userId);
$eventId = $this->args[1];

View File

@ -71,6 +71,9 @@ class ServerShell extends AppShell
public function pullAll()
{
$this->ConfigLoad->execute();
if (empty($this->args[0])) {
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['PullAll'] . PHP_EOL);
}
$userId = $this->args[0];
$user = $this->User->getAuthUser($userId);
@ -105,8 +108,9 @@ class ServerShell extends AppShell
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1])) {
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['pull'] . PHP_EOL);
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['Pull'] . PHP_EOL);
}
$userId = $this->args[0];
$user = $this->User->getAuthUser($userId);
if (empty($user)) {
@ -163,8 +167,9 @@ class ServerShell extends AppShell
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1])) {
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['push'] . PHP_EOL);
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['Push'] . PHP_EOL);
}
$userId = $this->args[0];
$user = $this->User->getAuthUser($userId);
if (empty($user)) die('Invalid user.' . PHP_EOL);
@ -218,6 +223,7 @@ class ServerShell extends AppShell
if (empty($this->args[0]) || empty($this->args[1])) {
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['Fetch feeds as local data'] . PHP_EOL);
}
$userId = $this->args[0];
$user = $this->User->getAuthUser($userId);
if (empty($user)) {
@ -287,8 +293,9 @@ class ServerShell extends AppShell
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1])) {
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['cacheServer'] . PHP_EOL);
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['Cache server'] . PHP_EOL);
}
$userId = $this->args[0];
$user = $this->User->getAuthUser($userId);
if (empty($user)) die('Invalid user.' . PHP_EOL);
@ -326,6 +333,7 @@ class ServerShell extends AppShell
if (empty($this->args[0]) || empty($this->args[1])) {
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['Cache feeds for quick lookups'] . PHP_EOL);
}
$userId = $this->args[0];
$user = $this->User->getAuthUser($userId);
if (empty($user)) die('Invalid user.' . PHP_EOL);
@ -376,6 +384,10 @@ class ServerShell extends AppShell
public function enqueuePull()
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1]) || empty($this->args[2])) {
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['Enqueue pull'] . PHP_EOL);
}
$timestamp = $this->args[0];
$userId = $this->args[1];
$taskId = $this->args[2];
@ -435,6 +447,10 @@ class ServerShell extends AppShell
public function enqueueFeedFetch()
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1]) || empty($this->args[2])) {
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['Enqueue feed fetch'] . PHP_EOL);
}
$timestamp = $this->args[0];
$userId = $this->args[1];
$taskId = $this->args[2];
@ -481,6 +497,10 @@ class ServerShell extends AppShell
public function enqueueFeedCache()
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1]) || empty($this->args[2])) {
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['Enqueue feed cache'] . PHP_EOL);
}
$timestamp = $this->args[0];
$userId = $this->args[1];
$taskId = $this->args[2];
@ -534,6 +554,10 @@ class ServerShell extends AppShell
public function enqueuePush()
{
$this->ConfigLoad->execute();
if (empty($this->args[0]) || empty($this->args[1]) || empty($this->args[2])) {
die('Usage: ' . $this->Server->command_line_functions['console_automation_tasks']['data']['Enqueue push'] . PHP_EOL);
}
$timestamp = $this->args[0];
$taskId = $this->args[1];
$userId = $this->args[2];

View File

@ -138,13 +138,17 @@ class Server extends AppModel
$this->command_line_functions = array(
'console_admin_tasks' => array(
'data' => array(
'Get setting' => 'MISP/app/Console/cake Admin getSetting [setting]',
'Get setting' => 'MISP/app/Console/cake Admin getSetting [setting|all]',
'Set setting' => 'MISP/app/Console/cake Admin setSetting [setting] [value]',
'Get authkey' => 'MISP/app/Console/cake Admin getAuthkey [email]',
'Get authkey' => 'MISP/app/Console/cake Admin getAuthkey [user_email]',
'Change authkey' => 'MISP/app/Console/cake Admin change_authkey [user_email] [authkey]',
'Set baseurl' => 'MISP/app/Console/cake Baseurl [baseurl]',
'Change password' => 'MISP/app/Console/cake Password [email] [new_password] [--override_password_change]',
'Clear Bruteforce Entries' => 'MISP/app/Console/cake Admin clearBruteforce [user_email]',
'Clean caches' => 'MISP/app/Console/cake Admin cleanCaches',
'Set database version' => 'MISP/app/Console/cake Admin setDatabaseVersion [version]',
'Run database update' => 'MISP/app/Console/cake Admin updateDatabase',
'Run updates' => 'MISP/app/Console/cake Admin runUpdates',
'Update all JSON structures' => 'MISP/app/Console/cake Admin updateJSON',
'Update Galaxy definitions' => 'MISP/app/Console/cake Admin updateGalaxies',
'Update taxonomy definitions' => 'MISP/app/Console/cake Admin updateTaxonomies',
@ -154,6 +158,17 @@ class Server extends AppModel
'Set default role' => 'MISP/app/Console/cake Admin setDefaultRole [role_id]',
'Get IPs for user ID' => 'MISP/app/Console/cake Admin UserIP [user_id]',
'Get user ID for user IP' => 'MISP/app/Console/cake Admin IPUser [ip]',
'Generate correlation' => 'MISP/app/Console/cake Admin jobGenerateCorrelation [job_id]',
'Purge correlation' => 'MISP/app/Console/cake Admin jobPurgeCorrelation [job_id]',
'Generate shadow attribute correlation' => 'MISP/app/Console/cake Admin jobGenerateShadowAttributeCorrelation [job_id]',
'Update MISP' => 'MISP/app/Console/cake Admin updateMISP',
'Update after pull' => 'MISP/app/Console/cake Admin updateAfterPull [submodule_name] [job_id] [user_id]',
'Job upgrade' => 'MISP/app/Console/cake Admin jobUpgrade24 [job_id] [user_id]',
'Prune update logs' => 'MISP/app/Console/cake Admin prune_update_logs [job_id] [user_id]',
'Recover since last successful update' => 'MISP/app/Console/cake Admin recoverSinceLastSuccessfulUpdate',
'Reset sync authkeys' => 'MISP/app/Console/cake Admin resetSyncAuthkeys [user_id]',
'Purge feed events' => 'MISP/app/Console/cake Admin purgeFeedEvents [user_id] [feed_id]',
'Dump current database schema' => 'MISP/app/Console/cake Admin dumpCurrentDatabaseSchema',
),
'description' => __('Certain administrative tasks are exposed to the API, these help with maintaining and configuring MISP in an automated way / via external tools.'),
'header' => __('Administering MISP via the CLI')
@ -161,13 +176,18 @@ class Server extends AppModel
'console_automation_tasks' => array(
'data' => array(
'PullAll' => 'MISP/app/Console/cake Server pullAll [user_id] [full|update]',
'Pull' => 'MISP/app/Console/cake Server pull [user_id] [server_id] [full|update]',
'Push' => 'MISP/app/Console/cake Server push [user_id] [server_id]',
'Cache feeds for quick lookups' => 'MISP/app/Console/cake Server cacheFeed [user_id] [feed_id|all|csv|text|misp]',
'Fetch feeds as local data' => 'MISP/app/Console/cake Server fetchFeed [user_id] [feed_id|all|csv|text|misp]',
'Pull' => 'MISP/app/Console/cake Server pull [user_id] [server_id] [full|update] [job_id]',
'Push' => 'MISP/app/Console/cake Server push [user_id] [server_id] [job_id]',
'Cache server' => 'MISP/app/Console/cake Server cacheServer [user_id] [feed_id|all|csv|text|misp] [job_id]',
'Cache feeds for quick lookups' => 'MISP/app/Console/cake Server cacheFeed [user_id] [feed_id|all|csv|text|misp] [job_id]',
'Fetch feeds as local data' => 'MISP/app/Console/cake Server fetchFeed [user_id] [feed_id|all|csv|text|misp] [job_id]',
'Run enrichment' => 'MISP/app/Console/cake Event enrichment [user_id] [event_id] [json_encoded_module_list]',
'Test' => 'MISP/app/Console/cake Server test [server_id]',
'List' => 'MISP/app/Console/cake Server list'
'List' => 'MISP/app/Console/cake Server list',
'Enqueue pull' => 'MISP/app/Console/cake Server enqueuePull [timestamp] [user_id] [task_id]',
'Enqueue push' => 'MISP/app/Console/cake Server enqueuePush [timestamp] [task_id] [user_id]',
'Enqueue feed fetch' => 'MISP/app/Console/cake Server enqueueFeedFetch [timestamp] [user_id] [task_id]',
'Enqueue feed cache' => 'MISP/app/Console/cake Server enqueueFeedCache [timestamp] [user_id] [task_id]',
),
'description' => __('If you would like to automate tasks such as caching feeds or pulling from server instances, you can do it using the following command line tools. Simply execute the given commands via the command line / create cron jobs easily out of them.'),
'header' => __('Automating certain console tasks')
@ -177,6 +197,7 @@ class Server extends AppModel
'Get list of workers' => 'MISP/app/Console/cake Admin getWorkers [all|dead]',
'Start a worker' => 'MISP/app/Console/cake Admin startWorker [queue_name]',
'Restart a worker' => 'MISP/app/Console/cake Admin restartWorker [worker_pid]',
'Restart all workers' => 'MISP/app/Console/cake Admin restartWorkers',
'Kill a worker' => 'MISP/app/Console/cake Admin killWorker [worker_pid]',
),
'description' => __('The background workers can be managed via the CLI in addition to the UI / API management tools'),