$message) { if (strpos($message_id, 'thold_message') !== false) { print strip_tags(str_replace('
', PHP_EOL, $message['message'])) . PHP_EOL; } } } } /** * Prints this script's name, version, and copyright banner to stdout. * * @return void * * @global array $config Cacti global configuration array; used to * locate setup.php when plugin_thold_version() * isn't already loaded. */ function display_version() { global $config; if (!function_exists('plugin_thold_version')) { include_once($config['base_path'] . '/plugins/thold/setup.php'); } $info = plugin_thold_version(); print 'Threshold Command Line Interface, Version ' . $info['version'] . ', ' . COPYRIGHT_YEARS . PHP_EOL; } /** * Prints this script's version banner followed by its command-line * usage instructions to stdout. * * @return void */ function display_help() { display_version(); print PHP_EOL; print 'usage: cli_thresholds.php --auto-create=N | [--host-ids=\'N1 N2 ...\'] [--graph-template=N] [--thold-template=N] [--graph-ids=\'N1 N2 ...\']' . PHP_EOL . PHP_EOL; print 'There are two usage methods:' . PHP_EOL . PHP_EOL; print 'The first requires you to specify the host id of the device and all existing Threshold templates' . PHP_EOL; print 'are applied to hosts.' . PHP_EOL . PHP_EOL; print '--auto-create=N - Auto Create all Thresholds for this Device id using Templates associated' . PHP_EOL; print ' the Devices Device Template.' . PHP_EOL . PHP_EOL; print 'The second requires you to specify either a series of Devices, a Graph Template, a Threshold Template' . PHP_EOL; print 'or a series of Graphs or any combination of the above. However, at least one must be specified.' . PHP_EOL; print 'Threshold Template and Graph IDs of the Graphs to be impacted.' . PHP_EOL . PHP_EOL; print '--host-ids=\'N1 N2 ...\' - The Devices ID to create Thresholds for' . PHP_EOL; print '--graph-template=N - The Graph Template to create Thresholds for' . PHP_EOL; print '--thold-template=N - The Threshold Template to use for creating Thresholds' . PHP_EOL; print '--graph-ids=\'N1 N2 ...\' - The Threshold Template to use for creating Thresholds' . PHP_EOL . PHP_EOL; }