'none', 1 => 'emergency', 2 => 'alert', 3 => 'critical', 4 => 'error', 5 => 'warning', 6 => 'notification', 7 => 'informational', 8 => 'debug' ]; $logging_categories = [ 'none' => 'No logging', 'all' => 'All categories', 'acl' => 'Access control', 'sys' => 'Internal system processes', 'slv' => 'Replication Slave processing', 'mstr' => 'Replication Master processing', 'ipc' => 'Client based inter process communication' ]; $process_status = [ 'RUNNING', 'CLOSEDOWN_BY_SIGNAL', 'CLOSEDOWN_BY_TIMEOUT', 'CLOSEDOWN_BY_VIOLATION', 'CLOSEDOWN_BY_CLIENT_CMD', 'CLOSEDOWN_BY_CLIENT_DROP', 'CLOSEDOWN_BY_AUTHENTICATION_FAILURE', ]; $colors = [ 'prompt' => ANSI_GREEN_FG, // green 'debug' => ANSI_CYAN_FG, // cyan 'normal' => ANSI_GREEN_FG, // green 'informational' => ANSI_BLUE_FG, // blue 'notification' => ANSI_WHITE_FG, // white 'warning' => ANSI_YELLOW_FG, // yellow 'error' => ANSI_RED_FG, // red 'critical' => ANSI_MAGENTA_FG, // magenta 'alert' => ANSI_MAGENTA_BG, // magenta background 'emergency' => ANSI_RED_BG, // red background ]; $rrdtool_env_vars = [ 'RRD_DEFAULT_FONT', 'RRDCACHED_STRIPPATH', ]; $rrdtool_custom_cmds = [ 'setenv', 'getenv', 'fc-list', 'setcnn', 'file_exists', 'filemtime', 'is_dir', 'mkdir', 'rmdir', 'unlink', 'rrd-list', 'archive', 'removespikes', 'version', ]; $rrdp_client_cnn_params = [ 'timeout', ]; $rrdtool_cmds = [ 'create', 'update', 'updatev', 'graph', 'graphv', 'dump', 'restore', 'last', 'lastupdate', 'first', 'info', 'fetch', 'tune', 'resize', 'xport', 'flushcached', ]; $rrdtool_msr_cmds = [ 'create', 'update', 'updatev', 'restore', 'tune', 'resize', 'mkdir', 'rmdir', 'unlink', 'archive', ]; $rrdp_replicator_cmds = [ 'REQUEST_SCANDIR', 'REQUEST_DUMP', 'REQUEST_LASTUPDATE', 'REQUEST_DIFF', 'RESPONSE_SCANDIR', 'RESPONSE_DUMP', 'RESPONSE_LASTUPDATE', 'RESPONSE_DIFF', ]; $rrdp_process_types = [ 'S' => 'replication slave', 'M' => 'replication master', 'C' => 'client' ]; $rrdp_aliases = ['?' => 'list', 'help' => 'list', 'exit' => 'quit']; $rrdp_help_messages = [ '?' => [ 0 => [ 'enable' => 'Turn on privileged commands', 'reset' => 'Reset terminal screen', 'show' => [ 'info' => 'Show running system information', '?' => [ 'status' => 'Return system status', 'threads'=> 'Display currently open connections', 'version'=> 'System software status', ] ], 'quit'=> 'Close terminal session', ], 1 => [ 'clear'=> [ 'info'=> 'Clear functions for internal buffers', '?' => [ 'logging'=> [ 'info'=> 'Clear logging buffer', '?' => [ 'buffered'=> 'Clear buffered log Cache', 'snmp' => 'Clear SNMP log Cache' ], ], 'counters' => 'Clear system counters', ], ], 'disable' => 'Turn off privileged commands', 'reset' => 'Reset terminal screen', 'set' => [ 'info'=> 'Configure proxy settings', '?' => [ 'rsa'=> [ 'info'=> 'Administrate encryption parameters', '?' => [ 'keys'=> 'Generate new RSA key pair' ], ], 'client'=> [ 'info'=> 'Administrate RRDtool Proxy Server clients', '?' => [ 'add' => 'Add trusted client connection', 'remove'=> 'Delete trusted client connection entry', ], ], 'cluster'=> [ 'info'=> 'Administrate RRDtool Proxy Server Cluster Peers', '?' => [ 'add' => 'Add a trusted peer', 'remove'=> 'Remove a trusted peer connection', 'update'=> 'Update IP address or fingerprint of a registered peer', ], ], 'logging'=> [ 'info'=> 'Administrate logging locations and levels', '?' => [ 'buffered'=> [ 'info' => 'Set GLOBAL buffered logging severity level (default:5)', '?' => array_slice($severity_levels,0,8) ], 'snmp'=> [ 'info' => 'Set GLOBAL SNMP logging severity level (default:5)', '?' => array_slice($severity_levels,0,8) ], 'terminal'=> [ 'info' => 'Set LOCAL terminal logging severity level (default:0) and categories (default: none)', '?' => [ 'level' => [ 'info' => 'Numerical representation of the severity level [0-8]', '?' => $severity_levels ], 'category' => [ 'info'=> 'Set logging category (default: all)', '?' => $logging_categories ], ], ], 'console'=> [ 'info' => 'Set LOCAL terminal logging severity level (default:0) and categories', '?' => [ 'level' => [ 'info' => 'Numerical representation of the severity level [0-8]', '?' => $severity_levels ], 'category' => [ 'info'=> 'Select one or more (comma separated) logging categories (default: none)', '?' => $logging_categories ], ], ], ], ], ], ], 'show'=> [ 'info'=> 'Show running system information', '?' => [ 'clients' => 'List all trusted client connections', 'counters'=> 'Return all system counters', 'cluster' => 'List all trusted cluster peers', 'logging' => [ 'info'=> 'Display state of logging', '?' => [ 'status' => 'Show logging overview', 'buffered'=> 'List buffered log entries', 'snmp' => 'Display SNMP logs' ] ], 'msr'=> [ 'info'=> 'Display replication state', '?' => [ 'buffer' => 'Display current replication buffer', 'health' => 'Health status', 'status' => 'Show current state of the MSR process', ], ], 'processes' => 'Display running child processes', 'rsa' => [ 'info'=> 'Show Encryption setup', '?' => [ 'publickey' => 'Display current public key and fingerprint', ], ], 'threads' => 'Display currently open connections', 'variables' => 'Show Current Operating configuration', 'version' => 'System software status', ] ], 'shutdown' => 'Close all connections and shut down proxy', 'quit' => 'Close terminal session', ], ], ]; $rrdp_status = [ 'aborted_clients' => 0, 'bytes_received' => 0, 'bytes_sent' => 0, 'connections' => 0, 'max_admin_connections' => 0, 'max_client_connections' => 0, 'memory_usage' => 'live', 'memory_peak_usage' => 'live', 'queries_rrdtool_total' => 0, 'queries_rrdtool_valid' => 0, 'queries_rrdtool_invalid' => 0, 'queries_system' => 0, 'threads_connected' => 'live', 'uptime' => 'live', 'connections_open' => 'live', 'connections_closed' => 0, 'connections_timeout' => 0, 'connections_broken' => 0, 'connections_aborted' => 0, 'connections_refused' => 0, 'msr_bytes_received' => 0, 'msr_bytes_sent' => 0, 'msr_connection_broken' => 0, 'rrd_pipe_broken' => 0, 'srv_bytes_received' => 0, 'srv_bytes_sent' => 0, 'srv_connection_broken' => 0, 'proc_closedown_by_signal' => 0, 'proc_closedown_by_timeout' => 0, 'proc_closedown_by_violation' => 0, 'proc_closedown_by_client_cmd' => 0, 'proc_closedown_by_client_drop' => 0, 'proc_closedown_by_decryption' => 0, 'proc_closedown_by_client_auth' => 0, 'rra_disk_size' => 0, 'rra_disk_used' => 0, 'rra_disk_avail' => 0, 'msr_disk_size' => 0, 'msr_disk_used' => 0, 'msr_disk_avail' => 0, ]; $rrdp_validate_filters = [ FILTER_VALIDATE_BOOLEAN, FILTER_VALIDATE_EMAIL, FILTER_VALIDATE_FLOAT, FILTER_VALIDATE_INT, FILTER_VALIDATE_IP, FILTER_VALIDATE_MAC, FILTER_VALIDATE_REGEXP, FILTER_VALIDATE_URL ];