From 7b98721e32162800835e5837e9cb391a6abef700 Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Wed, 21 Aug 2024 01:27:26 -0500 Subject: [PATCH] Poudriere support (#16229) * add the poller * save text status stuff * add initial app page stuff * add history table and start work on graphs * checkpoint * re-work the poudriere graph bits a bit more * fix the poller and start work on the graphs * polling fix * more work on the poudriere stuff * poke stuff with php-cs-fix * add some more graphs * more style fixes * another style fix * add more graphs * add Poudriere docs * add tests data * some minor tests fixes * a test tweak * more test tweaks * some more test tweaks * tweak .data.build_info data .data.build_info to make the app data test saner * derp... missed a item * add app data --- doc/Extensions/Applications.md | 30 + .../application/poudriere-common.inc.php | 30 + ...driere_context_switches_comparison.inc.php | 16 + .../poudriere_copy_on_write_faults.inc.php | 12 + .../application/poudriere_cpu_perc.inc.php | 12 + .../application/poudriere_cpu_time.inc.php | 12 + .../application/poudriere_data_size.inc.php | 12 + ...riere_involuntary_context_switches.inc.php | 12 + .../application/poudriere_log_size.inc.php | 20 + .../poudriere_major_faults.inc.php | 12 + .../application/poudriere_mem_perc.inc.php | 12 + .../poudriere_minor_faults.inc.php | 12 + .../poudriere_package_size.inc.php | 20 + .../application/poudriere_phase.inc.php | 66 ++ .../application/poudriere_read_blocks.inc.php | 12 + .../graphs/application/poudriere_rss.inc.php | 12 + .../poudriere_size_comparison.inc.php | 20 + .../application/poudriere_stack_size.inc.php | 12 + .../application/poudriere_status.inc.php | 36 + .../application/poudriere_swaps.inc.php | 12 + .../application/poudriere_system_time.inc.php | 12 + .../application/poudriere_text_size.inc.php | 12 + .../application/poudriere_threads.inc.php | 12 + .../graphs/application/poudriere_time.inc.php | 12 + .../poudriere_time_comparison.inc.php | 20 + .../application/poudriere_user_time.inc.php | 12 + ...udriere_voluntary_context_switches.inc.php | 12 + .../html/pages/device/apps/poudriere.inc.php | 334 ++++++ .../polling/applications/poudriere.inc.php | 129 +++ tests/data/linux_poudriere-v1.json | 952 ++++++++++++++++++ tests/snmpsim/linux_poudriere-v1.snmprec | 10 + 31 files changed, 1899 insertions(+) create mode 100644 includes/html/graphs/application/poudriere-common.inc.php create mode 100644 includes/html/graphs/application/poudriere_context_switches_comparison.inc.php create mode 100644 includes/html/graphs/application/poudriere_copy_on_write_faults.inc.php create mode 100644 includes/html/graphs/application/poudriere_cpu_perc.inc.php create mode 100644 includes/html/graphs/application/poudriere_cpu_time.inc.php create mode 100644 includes/html/graphs/application/poudriere_data_size.inc.php create mode 100644 includes/html/graphs/application/poudriere_involuntary_context_switches.inc.php create mode 100644 includes/html/graphs/application/poudriere_log_size.inc.php create mode 100644 includes/html/graphs/application/poudriere_major_faults.inc.php create mode 100644 includes/html/graphs/application/poudriere_mem_perc.inc.php create mode 100644 includes/html/graphs/application/poudriere_minor_faults.inc.php create mode 100644 includes/html/graphs/application/poudriere_package_size.inc.php create mode 100644 includes/html/graphs/application/poudriere_phase.inc.php create mode 100644 includes/html/graphs/application/poudriere_read_blocks.inc.php create mode 100644 includes/html/graphs/application/poudriere_rss.inc.php create mode 100644 includes/html/graphs/application/poudriere_size_comparison.inc.php create mode 100644 includes/html/graphs/application/poudriere_stack_size.inc.php create mode 100644 includes/html/graphs/application/poudriere_status.inc.php create mode 100644 includes/html/graphs/application/poudriere_swaps.inc.php create mode 100644 includes/html/graphs/application/poudriere_system_time.inc.php create mode 100644 includes/html/graphs/application/poudriere_text_size.inc.php create mode 100644 includes/html/graphs/application/poudriere_threads.inc.php create mode 100644 includes/html/graphs/application/poudriere_time.inc.php create mode 100644 includes/html/graphs/application/poudriere_time_comparison.inc.php create mode 100644 includes/html/graphs/application/poudriere_user_time.inc.php create mode 100644 includes/html/graphs/application/poudriere_voluntary_context_switches.inc.php create mode 100644 includes/html/pages/device/apps/poudriere.inc.php create mode 100644 includes/polling/applications/poudriere.inc.php create mode 100644 tests/data/linux_poudriere-v1.json create mode 100644 tests/snmpsim/linux_poudriere-v1.snmprec diff --git a/doc/Extensions/Applications.md b/doc/Extensions/Applications.md index d33803ff1d..9b57ae7de4 100644 --- a/doc/Extensions/Applications.md +++ b/doc/Extensions/Applications.md @@ -2106,6 +2106,36 @@ The application should be auto-discovered as described at the top of the page. If it is not, please follow the steps set out under `SNMP Extend` heading top of page. +## Poudriere + +### SNMP Extend + +1. Copy the extend into place +``` +wget https://github.com/librenms/librenms-agent/raw/master/snmp/poudriere -O /usr/local/etc/snmp/poudriere +``` + +2. Make it executable. +``` +chmod +x /usr/local/etc/snmp/poudriere +``` + +3. Install the depends +``` +pkg install p5-Data-Dumper p5-JSON p5-MIME-Base64 p5-File-Slurp +``` + +4. Setup the cronjob. The extend needs to be ran as root. See +`poudriere --help` for option info. +``` +4/5 * * * * root /usr/local/etc/snmp/poudriere -q -a -w -z +``` + +5. Add the extend to snmpd.conf and restart snmpd +``` +extend poudriere cat /var/cache/poudriere.json.snmp +``` + ## PowerDNS An authoritative DNS server: diff --git a/includes/html/graphs/application/poudriere-common.inc.php b/includes/html/graphs/application/poudriere-common.inc.php new file mode 100644 index 0000000000..5c052d24dd --- /dev/null +++ b/includes/html/graphs/application/poudriere-common.inc.php @@ -0,0 +1,30 @@ +app_id, 'jps___' . $vars['poudriere_set'] . '___' . $stat_to_add['stat']]); + } else { + $rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'totals_' . $stat_to_add['stat']]); + } + + if (Rrd::checkRrdExists($rrd_filename)) { + $rrd_list[] = [ + 'filename' => $rrd_filename, + 'descr' => $stat_to_add['descr'], + 'ds' => 'data', + ]; + } +} + +require 'includes/html/graphs/generic_multi_line.inc.php'; diff --git a/includes/html/graphs/application/poudriere_context_switches_comparison.inc.php b/includes/html/graphs/application/poudriere_context_switches_comparison.inc.php new file mode 100644 index 0000000000..083860a78b --- /dev/null +++ b/includes/html/graphs/application/poudriere_context_switches_comparison.inc.php @@ -0,0 +1,16 @@ + [ + 'stat' => 'voluntary-context-switches', + 'descr' => 'Voluntary Context', + ], + 'involuntary-context-switches' => [ + 'stat' => 'involuntary-context-switches', + 'descr' => 'Involuntary Context', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_copy_on_write_faults.inc.php b/includes/html/graphs/application/poudriere_copy_on_write_faults.inc.php new file mode 100644 index 0000000000..9a9f4adebb --- /dev/null +++ b/includes/html/graphs/application/poudriere_copy_on_write_faults.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'copy-on-write-faults', + 'descr' => 'COW Faults', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_cpu_perc.inc.php b/includes/html/graphs/application/poudriere_cpu_perc.inc.php new file mode 100644 index 0000000000..fb42ef7c52 --- /dev/null +++ b/includes/html/graphs/application/poudriere_cpu_perc.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'percent-cpu', + 'descr' => 'CPU%', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_cpu_time.inc.php b/includes/html/graphs/application/poudriere_cpu_time.inc.php new file mode 100644 index 0000000000..7c748d7610 --- /dev/null +++ b/includes/html/graphs/application/poudriere_cpu_time.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'cpu-time', + 'descr' => 'CPU Time', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_data_size.inc.php b/includes/html/graphs/application/poudriere_data_size.inc.php new file mode 100644 index 0000000000..1372a90756 --- /dev/null +++ b/includes/html/graphs/application/poudriere_data_size.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'data-size', + 'descr' => 'Data Size', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_involuntary_context_switches.inc.php b/includes/html/graphs/application/poudriere_involuntary_context_switches.inc.php new file mode 100644 index 0000000000..ab144b713a --- /dev/null +++ b/includes/html/graphs/application/poudriere_involuntary_context_switches.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'involuntary-context-switches', + 'descr' => 'Involuntary Context', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_log_size.inc.php b/includes/html/graphs/application/poudriere_log_size.inc.php new file mode 100644 index 0000000000..135781467a --- /dev/null +++ b/includes/html/graphs/application/poudriere_log_size.inc.php @@ -0,0 +1,20 @@ + [ + 'stat' => 'log_size_done', + 'descr' => 'done', + ], + 'log_size_latest' => [ + 'stat' => 'log_size_latest', + 'descr' => 'latest', + ], + 'log_size_per_package' => [ + 'stat' => 'log_size_per_package', + 'descr' => 'per_package', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_major_faults.inc.php b/includes/html/graphs/application/poudriere_major_faults.inc.php new file mode 100644 index 0000000000..b651bb49df --- /dev/null +++ b/includes/html/graphs/application/poudriere_major_faults.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'major-faults', + 'descr' => 'Major Faults', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_mem_perc.inc.php b/includes/html/graphs/application/poudriere_mem_perc.inc.php new file mode 100644 index 0000000000..f502acc228 --- /dev/null +++ b/includes/html/graphs/application/poudriere_mem_perc.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'percent-memory', + 'descr' => 'Mem%', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_minor_faults.inc.php b/includes/html/graphs/application/poudriere_minor_faults.inc.php new file mode 100644 index 0000000000..57402cbc43 --- /dev/null +++ b/includes/html/graphs/application/poudriere_minor_faults.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'minor-faults', + 'descr' => 'Minor Faults', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_package_size.inc.php b/includes/html/graphs/application/poudriere_package_size.inc.php new file mode 100644 index 0000000000..5d19d7da15 --- /dev/null +++ b/includes/html/graphs/application/poudriere_package_size.inc.php @@ -0,0 +1,20 @@ + [ + 'stat' => 'package_size_all', + 'descr' => 'all', + ], + 'package_size_building' => [ + 'stat' => 'package_size_building', + 'descr' => 'building', + ], + 'package_size_latest' => [ + 'stat' => 'package_size_latest', + 'descr' => 'latest', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_phase.inc.php b/includes/html/graphs/application/poudriere_phase.inc.php new file mode 100644 index 0000000000..b8056c2af3 --- /dev/null +++ b/includes/html/graphs/application/poudriere_phase.inc.php @@ -0,0 +1,66 @@ + [ + 'stat' => 'check-sanity', + 'descr' => 'check-sanity', + ], + 'pkg-depends' => [ + 'stat' => 'pkg-depends', + 'descr' => 'pkg-depends', + ], + 'fetch-depends' => [ + 'stat' => 'fetch-depends', + 'descr' => 'fetch-depends', + ], + 'fetch checksum' => [ + 'stat' => 'fetch checksum', + 'descr' => 'fetch checksum', + ], + 'extract-depends' => [ + 'stat' => 'extract-depends', + 'descr' => 'extract-depends', + ], + 'extract patch-depends' => [ + 'stat' => 'extract patch-depends', + 'descr' => 'extract patch-depends', + ], + 'patch' => [ + 'stat' => 'patch', + 'descr' => 'patch', + ], + 'build-depends' => [ + 'stat' => 'build-depends', + 'descr' => 'build-depends', + ], + 'lib-depends' => [ + 'stat' => 'lib-depends', + 'descr' => 'lib-depends', + ], + 'configure' => [ + 'stat' => 'configure', + 'descr' => 'configure', + ], + 'build' => [ + 'stat' => 'build', + 'descr' => 'build', + ], + 'run-depends' => [ + 'stat' => 'run-depends', + 'descr' => 'run-depends', + ], + 'stage' => [ + 'stat' => 'stage', + 'descr' => 'stage', + ], + 'package' => [ + 'stat' => 'package', + 'descr' => 'package', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_read_blocks.inc.php b/includes/html/graphs/application/poudriere_read_blocks.inc.php new file mode 100644 index 0000000000..e8d4c27a6c --- /dev/null +++ b/includes/html/graphs/application/poudriere_read_blocks.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'read-blocks', + 'descr' => 'Read Blocks', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_rss.inc.php b/includes/html/graphs/application/poudriere_rss.inc.php new file mode 100644 index 0000000000..130bf91d48 --- /dev/null +++ b/includes/html/graphs/application/poudriere_rss.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'rss', + 'descr' => 'RSS', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_size_comparison.inc.php b/includes/html/graphs/application/poudriere_size_comparison.inc.php new file mode 100644 index 0000000000..3d9a957a04 --- /dev/null +++ b/includes/html/graphs/application/poudriere_size_comparison.inc.php @@ -0,0 +1,20 @@ + [ + 'stat' => 'stack-size', + 'descr' => 'Stack Size', + ], + 'data-size' => [ + 'stat' => 'data-size', + 'descr' => 'Data Size', + ], + 'text-size' => [ + 'stat' => 'text-size', + 'descr' => 'Text Size', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_stack_size.inc.php b/includes/html/graphs/application/poudriere_stack_size.inc.php new file mode 100644 index 0000000000..ba7197a372 --- /dev/null +++ b/includes/html/graphs/application/poudriere_stack_size.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'stack-size', + 'descr' => 'Stack Size', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_status.inc.php b/includes/html/graphs/application/poudriere_status.inc.php new file mode 100644 index 0000000000..f333303423 --- /dev/null +++ b/includes/html/graphs/application/poudriere_status.inc.php @@ -0,0 +1,36 @@ + [ + 'stat' => 'QUEUE', + 'descr' => 'QUEUE', + ], + 'BUILT' => [ + 'stat' => 'BUILT', + 'descr' => 'BUILT', + ], + 'FAIL' => [ + 'stat' => 'FAIL', + 'descr' => 'FAIL', + ], + 'SKIP' => [ + 'stat' => 'SKIP', + 'descr' => 'SKIP', + ], + 'IGNORE' => [ + 'stat' => 'IGNORE', + 'descr' => 'IGNORE', + ], + 'REMAIN' => [ + 'stat' => 'REMAIN', + 'descr' => 'REMAIN', + ], + 'FETCH' => [ + 'stat' => 'FETCH', + 'descr' => 'FETCH', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_swaps.inc.php b/includes/html/graphs/application/poudriere_swaps.inc.php new file mode 100644 index 0000000000..4412321201 --- /dev/null +++ b/includes/html/graphs/application/poudriere_swaps.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'swaps', + 'descr' => 'Swaps', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_system_time.inc.php b/includes/html/graphs/application/poudriere_system_time.inc.php new file mode 100644 index 0000000000..ab2fcc1b1e --- /dev/null +++ b/includes/html/graphs/application/poudriere_system_time.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'system-time', + 'descr' => 'System Time', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_text_size.inc.php b/includes/html/graphs/application/poudriere_text_size.inc.php new file mode 100644 index 0000000000..5d9acba58c --- /dev/null +++ b/includes/html/graphs/application/poudriere_text_size.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'text-size', + 'descr' => 'Text Size', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_threads.inc.php b/includes/html/graphs/application/poudriere_threads.inc.php new file mode 100644 index 0000000000..6e05b73405 --- /dev/null +++ b/includes/html/graphs/application/poudriere_threads.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'threads', + 'descr' => 'Threads', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_time.inc.php b/includes/html/graphs/application/poudriere_time.inc.php new file mode 100644 index 0000000000..f63e135b0c --- /dev/null +++ b/includes/html/graphs/application/poudriere_time.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'TIME', + 'descr' => 'TIME', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_time_comparison.inc.php b/includes/html/graphs/application/poudriere_time_comparison.inc.php new file mode 100644 index 0000000000..5f48a4b239 --- /dev/null +++ b/includes/html/graphs/application/poudriere_time_comparison.inc.php @@ -0,0 +1,20 @@ + [ + 'stat' => 'cpu-time', + 'descr' => 'CPU Time', + ], + 'system-time' => [ + 'stat' => 'system-time', + 'descr' => 'System Time', + ], + 'user-time' => [ + 'stat' => 'user-time', + 'descr' => 'User Time', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_user_time.inc.php b/includes/html/graphs/application/poudriere_user_time.inc.php new file mode 100644 index 0000000000..ab2fcc1b1e --- /dev/null +++ b/includes/html/graphs/application/poudriere_user_time.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'system-time', + 'descr' => 'System Time', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/graphs/application/poudriere_voluntary_context_switches.inc.php b/includes/html/graphs/application/poudriere_voluntary_context_switches.inc.php new file mode 100644 index 0000000000..f30e912ca6 --- /dev/null +++ b/includes/html/graphs/application/poudriere_voluntary_context_switches.inc.php @@ -0,0 +1,12 @@ + [ + 'stat' => 'voluntary-context-switches', + 'descr' => 'Voluntary Context', + ], +]; + +require 'poudriere-common.inc.php'; diff --git a/includes/html/pages/device/apps/poudriere.inc.php b/includes/html/pages/device/apps/poudriere.inc.php new file mode 100644 index 0000000000..282ff6f230 --- /dev/null +++ b/includes/html/pages/device/apps/poudriere.inc.php @@ -0,0 +1,334 @@ + 'device', + 'device' => $device['device_id'], + 'tab' => 'apps', + 'app' => 'poudriere', +]; + +$app_data = $app->data; + +print_optionbar_start(); + +// print the link to the totals +$label = (isset($vars['poudriere_page']) || isset($vars['poudriere_set'])) + ? 'Totals' + : 'Totals'; +echo generate_link($label, $link_array); +echo ' | '; + +// print the link to the details page +$label = (! isset($vars['poudriere_page']) && $vars['poudriere_page'] != 'details') + ? 'Details' + : 'Details'; +echo generate_link($label, $link_array, ['poudriere_page' => 'details']); +echo ' | Sets: '; + +$index_int = 0; +foreach ($app_data['sets'] as $index => $set_name) { + $label = (! isset($vars['poudriere_set']) || $vars['poudriere_set'] != $set_name) + ? $set_name + : '' . $set_name . ''; + $index_int++; + echo generate_link($label, $link_array, ['poudriere_set' => $set_name]); + if (isset($app_data['sets'][$index_int])) { + echo ', '; + } +} + +print_optionbar_end(); + +$graphs = []; +if (isset($vars['poudriere_page']) && $vars['poudriere_page'] == 'details') { + print_optionbar_start(); + if (isset($app_data['status']) && ! is_null($app_data['status'])) { + echo "
Status

\n"; + $table = [ + 'headers' => [ + 'Set', + 'Ports', + 'Jail', + 'Build', + 'Status', + 'Queue', + 'Built', + 'Fail', + 'Skip', + 'Ignore', + 'Fetch', + 'Remain', + 'Time', + 'Logs', + ], + 'rows' => [], + ]; + $status_split = explode("\n", $app_data['status']); + $status_split_int = 1; + while (isset($status_split[$status_split_int])) { + $line = preg_replace("/^\s+/", '', $status_split[$status_split_int]); + $row = preg_split("/\s+/", $line, 14); + if (isset($row[13])) { + $table['rows'][] = [ + ['data' => $row[0]], + ['data' => $row[1]], + ['data' => $row[2]], + ['data' => $row[3]], + ['data' => $row[4]], + ['data' => $row[5]], + ['data' => $row[6]], + ['data' => $row[7]], + ['data' => $row[8]], + ['data' => $row[9]], + ['data' => $row[10]], + ['data' => $row[11]], + ['data' => $row[12]], + ['data' => $row[13]], + ]; + } + $status_split_int++; + } + echo view('widgets/sortable_table', $table); + } + if (isset($app_data['build_info']) && ! is_null($app_data['build_info'])) { + echo "
Build Info

\n"; + $table = [ + 'headers' => [ + 'Set', + 'Build', + 'ID', + 'Total', + 'Origin', + 'Pkg Name', + 'Phase', + 'Time', + 'TMP FS', + 'CPU%', + 'MEM%', + ], + 'rows' => [], + ]; + $build_split = explode("\n", $app_data['build_info']); + $build_split_int = 0; + while (isset($build_split[$build_split_int])) { + $line = preg_replace("/^\s+/", '', $build_split[$build_split_int]); + if (preg_match('/\[.*\]\ +\[.*\]\ +\[.*\]/', $line)) { + $row = preg_split("/\s+/", $line, 14); + if (isset($row[0])) { + $current_set = preg_replace("/[\[\]]/", '', $row[0]); + } else { + $current_set = ''; + } + if (isset($row[1])) { + $current_build = preg_replace("/[\[\]]/", '', $row[1]); + } else { + $current_build = ''; + } + } elseif (preg_match('/^\[.*\]/', $line)) { + $line_split = preg_split("/[^\w\d\-\,\.\:\/\@\%]+/", $line, 14); + if (isset($line_split[9])) { + $tmp_fs = $line_split[7]; + $cpu_perc = $line_split[8]; + $mem_perc = $line_split[9]; + } else { + $tmp_fs = '-'; + $cpu_perc = $line_split[7]; + $mem_perc = $line_split[8]; + } + $table['rows'][] = [ + ['data' => $current_set], + ['data' => $current_build], + ['data' => $line_split[1]], + ['data' => $line_split[2]], + ['data' => $line_split[3]], + ['data' => $line_split[4]], + ['data' => $line_split[5]], + ['data' => $line_split[6]], + ['data' => $tmp_fs], + ['data' => $cpu_perc], + ['data' => $mem_perc], + ]; + } + + $build_split_int++; + } + echo view('widgets/sortable_table', $table); + } + if (isset($app_data['history']) && ! is_null($app_data['history'])) { + echo "
History

\n"; + $table = [ + 'headers' => [ + 'Set', + 'Ports', + 'Jail', + 'Build', + 'Status', + 'Queue', + 'Built', + 'Fail', + 'Skip', + 'Ignore', + 'Fetch', + 'Remain', + 'Time', + 'Logs', + ], + 'rows' => [], + ]; + $status_split = explode("\n", $app_data['history']); + $status_split_int = 1; + while (isset($status_split[$status_split_int])) { + $line = preg_replace("/^\s+/", '', $status_split[$status_split_int]); + $row = preg_split("/\s+/", $line, 14); + if (isset($row[13])) { + $table['rows'][] = [ + ['data' => $row[0]], + ['data' => $row[1]], + ['data' => $row[2]], + ['data' => $row[3]], + ['data' => $row[4]], + ['data' => $row[5]], + ['data' => $row[6]], + ['data' => $row[7]], + ['data' => $row[8]], + ['data' => $row[9]], + ['data' => $row[10]], + ['data' => $row[11]], + ['data' => $row[12]], + ['data' => $row[13]], + ]; + } + $status_split_int++; + } + echo view('widgets/sortable_table', $table); + } + print_optionbar_end(); +} else { + $graphs = [ + [ + 'type' => 'status', + 'description' => 'General Status', + ], + [ + 'type' => 'phase', + 'description' => 'Build Phase', + ], + [ + 'type' => 'time', + 'description' => 'Build Time', + ], + [ + 'type' => 'log_size', + 'description' => 'Log Size', + ], + [ + 'type' => 'package_size', + 'description' => 'Package Size', + ], + [ + 'type' => 'cpu_perc', + 'description' => 'CPU%', + ], + [ + 'type' => 'mem_perc', + 'description' => 'Memory%', + ], + [ + 'type' => 'time_comparison', + 'description' => 'Time Comparison(CPU, User, System)', + ], + [ + 'type' => 'cpu_time', + 'description' => 'Time, CPU', + ], + [ + 'type' => 'user_time', + 'description' => 'Time, User', + ], + [ + 'type' => 'system_time', + 'description' => 'Time, System', + ], + [ + 'type' => 'rss', + 'description' => 'RSS', + ], + [ + 'type' => 'threads', + 'description' => 'Threads', + ], + [ + 'type' => 'major_faults', + 'description' => 'Faults, Major', + ], + [ + 'type' => 'minor_faults', + 'description' => 'Faults, Minor', + ], + [ + 'type' => 'swaps', + 'description' => 'Swaps', + ], + [ + 'type' => 'size_comparison', + 'description' => 'Size, Comparison(Stack, Data, Text)', + ], + [ + 'type' => 'stack_size', + 'description' => 'Size, Stack', + ], + [ + 'type' => 'data_size', + 'description' => 'Size, Data', + ], + [ + 'type' => 'text_size', + 'description' => 'Size, Text', + ], + [ + 'type' => 'read_blocks', + 'description' => 'Read Blocks', + ], + [ + 'type' => 'copy_on_write_faults', + 'description' => 'COW Faults', + ], + [ + 'type' => 'context_switches_comparison', + 'description' => 'Context Switches Comparison(Voluntary, Involuntary)', + ], + [ + 'type' => 'voluntary_context_switches', + 'description' => 'Context Switches, Voluntary', + ], + [ + 'type' => 'involuntary_context_switches', + 'description' => 'Context Switches, Involuntary', + ], + ]; +} + +foreach ($graphs as $key => $graph_info) { + $graph_type = $graph_info['type']; + $graph_array['height'] = '100'; + $graph_array['width'] = '215'; + $graph_array['to'] = time(); + $graph_array['id'] = $app['app_id']; + $graph_array['type'] = 'application_' . $name . '_' . $graph_info['type']; + if (isset($vars['poudriere_set'])) { + $graph_array['poudriere_set'] = $vars['poudriere_set']; + } + + echo '
+
+

' . $graph_info['description'] . '

+
+
+
'; + include 'includes/html/print-graphrow.inc.php'; + echo '
'; + echo '
'; + echo '
'; +} diff --git a/includes/polling/applications/poudriere.inc.php b/includes/polling/applications/poudriere.inc.php new file mode 100644 index 0000000000..8f6d0a81df --- /dev/null +++ b/includes/polling/applications/poudriere.inc.php @@ -0,0 +1,129 @@ +getCode() . ':' . $e->getMessage() . PHP_EOL; + update_application($app, $e->getCode() . ':' . $e->getMessage(), []); // Set empty metrics and error message + + return; +} + +$stat_vars = [ + 'BUILT', + 'FAIL', + 'FETCH', + 'IGNORE', + 'QUEUE', + 'REMAIN', + 'SKIP', + 'TIME', + 'build', + 'build-depends', + 'check-sanity', + 'checksum', + 'configure', + 'copy-on-write-faults', + 'cpu-time', + 'data-size', + 'elapsed-times', + 'extract', + 'extract-depends', + 'fetch', + 'fetch-depends', + 'involuntary-context-switches', + 'job-control-count', + 'lib-depends', + 'log_size_done', + 'log_size_latest', + 'log_size_per_package', + 'major-faults', + 'minor-faults', + 'package', + 'package_size_all', + 'package_size_building', + 'package_size_latest', + 'patch', + 'patch-depends', + 'percent-cpu', + 'percent-memory', + 'pkg-depends', + 'read-blocks', + 'received-messages', + 'rss', + 'run-depends', + 'sent-messages', + 'stack-size', + 'stage', + 'swaps', + 'system-time', + 'text-size', + 'threads', + 'user-time', + 'voluntary-context-switches', + 'written-blocks', +]; + +$metrics = []; +$old_data = $app->data; +$new_data = [ + 'status' => $returned['data']['status'], + 'build_info' => $returned['data']['build_info'], + 'history' => $returned['data']['history'], +]; + +$data = $returned['data']; + +$gauge_rrd_def = RrdDefinition::make() + ->addDataset('data', 'GAUGE', 0); + +// process total stats, .data.stats +foreach ($stat_vars as $key => $stat) { + $var_name = 'totals_' . $stat; + $value = $data['stats'][$stat]; + $rrd_name = ['app', $name, $app->app_id, $var_name]; + $fields = ['data' => $value]; + $metrics[$var_name] = $value; + $tags = ['name' => $name, 'app_id' => $app->app_id, 'rrd_def' => $gauge_rrd_def, 'rrd_name' => $rrd_name]; + data_update($device, 'app', $tags, $fields); +} + +// process each jail/ports/sets item +$sets = []; +foreach ($data['jailANDportsANDset'] as $jps_key => $jps) { + $sets[] = $jps_key; + foreach ($stat_vars as $key => $stat) { + $var_name = 'jps___' . $jps_key . '___' . $stat; + $value = $jps[$stat]; + $rrd_name = ['app', $name, $app->app_id, $var_name]; + $fields = ['data' => $value]; + $metrics[$var_name] = $value; + $tags = ['name' => $name, 'app_id' => $app->app_id, 'rrd_def' => $gauge_rrd_def, 'rrd_name' => $rrd_name]; + data_update($device, 'app', $tags, $fields); + } +} + +// check for added or removed jps sets +sort($sets); +$old_sets = $old_data['sets'] ?? []; +$added_sets = array_diff($sets, $old_sets); +$removed_sets = array_diff($old_sets, $sets); +$new_data['sets'] = $sets; + +$app->data = $new_data; + +// if we have any source instances, save and log +if (count($added_sets) > 0 || count($removed_sets) > 0) { + $log_message = 'Poudriere jail/ports/sets Change:'; + $log_message .= count($added_sets) > 0 ? ' Added ' . implode(',', $added_sets) : ''; + $log_message .= count($removed_sets) > 0 ? ' Removed ' . implode(',', $added_sets) : ''; + log_event($log_message, $device, 'application'); +} + +// all done so update the app metrics +update_application($app, 'OK', $metrics); diff --git a/tests/data/linux_poudriere-v1.json b/tests/data/linux_poudriere-v1.json new file mode 100644 index 0000000000..700a90b4f2 --- /dev/null +++ b/tests/data/linux_poudriere-v1.json @@ -0,0 +1,952 @@ +{ + "applications": { + "discovery": { + "applications": [ + { + "app_type": "poudriere", + "app_state": "UNKNOWN", + "discovered": 1, + "app_state_prev": null, + "app_status": "", + "app_instance": "", + "data": null, + "deleted_at": null + } + ] + }, + "poller": { + "applications": [ + { + "app_type": "poudriere", + "app_state": "OK", + "discovered": 1, + "app_state_prev": "UNKNOWN", + "app_status": "", + "app_instance": "", + "data": "{\"status\":\"test2\",\"build_info\":\"test\",\"history\":null,\"sets\":[\"13relengAMD64-default\",\"13relengI386-default\"]}", + "deleted_at": null + } + ], + "application_metrics": [ + { + "metric": "jps___13relengAMD64-default___build", + "value": 1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___build-depends", + "value": 1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___BUILT", + "value": 619, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___check-sanity", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___checksum", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___configure", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___copy-on-write-faults", + "value": 1279, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___cpu-time", + "value": 18.43, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___data-size", + "value": 11664, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___elapsed-times", + "value": 20231, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___extract", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___extract-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___FAIL", + "value": 1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___FETCH", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___fetch-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___IGNORE", + "value": 1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___involuntary-context-switches", + "value": 1013, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___job-control-count", + "value": 9, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___lib-depends", + "value": 1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___log_size_done", + "value": 85340321, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___log_size_latest", + "value": 2688695871, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___log_size_per_package", + "value": 4148883673, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___major-faults", + "value": 11, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___minor-faults", + "value": 67178, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___package", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___package_size_all", + "value": 13389068464, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___package_size_building", + "value": 3682385, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___package_size_latest", + "value": 19989984, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___patch", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___patch-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___percent-cpu", + "value": 0.1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___percent-memory", + "value": 0.1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___pkg-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___QUEUE", + "value": 648, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___read-blocks", + "value": 1458, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___received-messages", + "value": 23403, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___REMAIN", + "value": 22, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___rss", + "value": 296128, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___run-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___sent-messages", + "value": 23, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___SKIP", + "value": 5, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___stack-size", + "value": 1792, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___stage", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___swaps", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___system-time", + "value": 1.13, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___text-size", + "value": 33080, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___threads", + "value": 14, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___TIME", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___user-time", + "value": 17.31, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___voluntary-context-switches", + "value": 46413, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengAMD64-default___written-blocks", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___build", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___build-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___BUILT", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___check-sanity", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___checksum", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___configure", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___copy-on-write-faults", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___cpu-time", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___data-size", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___elapsed-times", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___extract", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___extract-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___FAIL", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___FETCH", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___fetch-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___IGNORE", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___involuntary-context-switches", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___job-control-count", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___lib-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___log_size_done", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___log_size_latest", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___log_size_per_package", + "value": 179070691, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___major-faults", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___minor-faults", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___package", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___package_size_all", + "value": 772420452, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___package_size_building", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___package_size_latest", + "value": 19816680, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___patch", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___patch-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___percent-cpu", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___percent-memory", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___pkg-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___QUEUE", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___read-blocks", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___received-messages", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___REMAIN", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___rss", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___run-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___sent-messages", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___SKIP", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___stack-size", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___stage", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___swaps", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___system-time", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___text-size", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___threads", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___TIME", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___user-time", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___voluntary-context-switches", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "jps___13relengI386-default___written-blocks", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_build", + "value": 1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_build-depends", + "value": 1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_BUILT", + "value": 619, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_check-sanity", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_checksum", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_configure", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_copy-on-write-faults", + "value": 1279, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_cpu-time", + "value": 18.43, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_data-size", + "value": 11664, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_elapsed-times", + "value": 20231, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_extract", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_extract-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_FAIL", + "value": 1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_FETCH", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_fetch-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_IGNORE", + "value": 1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_involuntary-context-switches", + "value": 1013, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_job-control-count", + "value": 9, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_lib-depends", + "value": 1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_log_size_done", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_log_size_latest", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_log_size_per_package", + "value": 179070691, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_major-faults", + "value": 11, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_minor-faults", + "value": 67178, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_package", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_package_size_all", + "value": 772420452, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_package_size_building", + "value": 3682385, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_package_size_latest", + "value": 19816680, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_patch", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_patch-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_percent-cpu", + "value": 0.1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_percent-memory", + "value": 0.1, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_pkg-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_QUEUE", + "value": 648, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_read-blocks", + "value": 1458, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_received-messages", + "value": 23403, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_REMAIN", + "value": 22, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_rss", + "value": 296128, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_run-depends", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_sent-messages", + "value": 23, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_SKIP", + "value": 5, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_stack-size", + "value": 1792, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_stage", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_swaps", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_system-time", + "value": 1.13, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_text-size", + "value": 33080, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_threads", + "value": 14, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_TIME", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_user-time", + "value": 17.31, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_voluntary-context-switches", + "value": 46413, + "value_prev": null, + "app_type": "poudriere" + }, + { + "metric": "totals_written-blocks", + "value": 0, + "value_prev": null, + "app_type": "poudriere" + } + ] + } + } +} diff --git a/tests/snmpsim/linux_poudriere-v1.snmprec b/tests/snmpsim/linux_poudriere-v1.snmprec new file mode 100644 index 0000000000..6983b287c5 --- /dev/null +++ b/tests/snmpsim/linux_poudriere-v1.snmprec @@ -0,0 +1,10 @@ +1.3.6.1.2.1.1.1.0|4|Linux server 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.8072.3.2.10 +1.3.6.1.2.1.1.3.0|67|77550514 +1.3.6.1.2.1.1.4.0|4| +1.3.6.1.2.1.1.5.0|4| +1.3.6.1.2.1.1.6.0|4| +1.3.6.1.2.1.25.1.1.0|67|77552962 +1.3.6.1.4.1.8072.1.3.2.2.1.21.6.100.105.115.116.114.111|2|1 +1.3.6.1.4.1.8072.1.3.2.2.1.21.9.112.111.117.100.114.105.101.114.101|2|1 +1.3.6.1.4.1.8072.1.3.2.3.1.2.9.112.111.117.100.114.105.101.114.101|4x|7b0a20202264617461223a207b0a20202020226275696c645f696e666f223a202274657374222c0a20202020226a61696c414e44706f727473414e44736574223a207b0a20202020202022313372656c656e67414d4436342d64656661756c74223a207b0a2020202020202020224255494c44223a2022323032342d30372d32345f30386835396d303273222c0a2020202020202020224255494c54223a2022363139222c0a2020202020202020224641494c223a202231222c0a2020202020202020224645544348223a202230222c0a20202020202020202249474e4f5245223a202231222c0a2020202020202020224a41494c223a2022313372656c656e67414d443634222c0a2020202020202020224c4f4753223a20222f7372632f646174612f6c6f67732f62756c6b2f313372656c656e67414d4436342d64656661756c742f323032342d30372d32345f30386835396d303273222c0a202020202020202022504f525453223a202264656661756c74222c0a2020202020202020225155455545223a2022363438222c0a20202020202020202252454d41494e223a20223232222c0a202020202020202022534554223a20222d222c0a202020202020202022534b4950223a202235222c0a202020202020202022535441545553223a2022706172616c6c656c5f6275696c64222c0a20202020202020202254494d45223a202230222c0a2020202020202020226275696c64223a20312c0a2020202020202020226275696c642d646570656e6473223a20312c0a202020202020202022636865636b2d73616e697479223a20302c0a202020202020202022636865636b73756d223a20302c0a202020202020202022636f6e666967757265223a20302c0a202020202020202022636f70792d6f6e2d77726974652d6661756c7473223a20313237392c0a2020202020202020226370752d74696d65223a2031382e34332c0a202020202020202022646174612d73697a65223a2031313636342c0a202020202020202022656c61707365642d74696d6573223a2032303233312c0a20202020202020202265787472616374223a20302c0a202020202020202022657874726163742d646570656e6473223a20302c0a2020202020202020226665746368223a20302c0a20202020202020202266657463682d646570656e6473223a20302c0a202020202020202022696e766f6c756e746172792d636f6e746578742d7377697463686573223a20313031332c0a2020202020202020226a6f622d636f6e74726f6c2d636f756e74223a20392c0a2020202020202020226c69622d646570656e6473223a20312c0a2020202020202020226c6f675f73697a655f646f6e65223a2038353334303332312c0a2020202020202020226c6f675f73697a655f6c6174657374223a20323638383639353837312c0a2020202020202020226c6f675f73697a655f7065725f7061636b616765223a20343134383838333637332c0a2020202020202020226c6f67735f6469725f646f6e65223a20222f7372632f646174612f6c6f67732f62756c6b2f313372656c656e67414d4436342d64656661756c742f323032342d30372d32335f32306830366d3332732f6c6f6773222c0a2020202020202020226c6f67735f6469725f6c6174657374223a20222f7372632f646174612f6c6f67732f62756c6b2f313372656c656e67414d4436342d64656661756c742f323032342d30372d32345f30386835396d3032732f6c6f6773222c0a2020202020202020226c6f67735f6469725f7065725f7061636b616765223a20222f7372632f646174612f6c6f67732f62756c6b2f313372656c656e67414d4436342d64656661756c742f6c61746573742d7065722d706b67222c0a2020202020202020226d616a6f722d6661756c7473223a2031312c0a2020202020202020226d696e6f722d6661756c7473223a2036373137382c0a2020202020202020227061636b616765223a20302c0a2020202020202020227061636b6167655f73697a655f616c6c223a2031333338393036383436342c0a2020202020202020227061636b6167655f73697a655f6275696c64696e67223a20333638323338352c0a2020202020202020227061636b6167655f73697a655f6c6174657374223a2031393938393938342c0a2020202020202020227061636b616765735f6469725f616c6c223a20222f7372632f646174612f7061636b616765732f313372656c656e67414d4436342d64656661756c742f2e7265616c5f313732313739343339372f416c6c222c0a2020202020202020227061636b616765735f6469725f6275696c64696e67223a20222f7372632f646174612f7061636b616765732f313372656c656e67414d4436342d64656661756c742f2e6275696c64696e67222c0a2020202020202020227061636b616765735f6469725f6c6174657374223a20222f7372632f646174612f7061636b616765732f313372656c656e67414d4436342d64656661756c742f2e7265616c5f313732313739343339372f4c6174657374222c0a2020202020202020227061746368223a20302c0a20202020202020202270617463682d646570656e6473223a20302c0a20202020202020202270657263656e742d637075223a20302e312c0a20202020202020202270657263656e742d6d656d6f7279223a20302e312c0a202020202020202022706b672d646570656e6473223a20302c0a202020202020202022726561642d626c6f636b73223a20313435382c0a20202020202020202272656365697665642d6d65737361676573223a2032333430332c0a202020202020202022727373223a203239363132382c0a20202020202020202272756e2d646570656e6473223a20302c0a20202020202020202273656e742d6d65737361676573223a2032332c0a202020202020202022737461636b2d73697a65223a20313739322c0a2020202020202020227374616765223a20302c0a2020202020202020227377617073223a20302c0a20202020202020202273797374656d2d74696d65223a20312e31332c0a202020202020202022746578742d73697a65223a2033333038302c0a20202020202020202274687265616473223a2031342c0a202020202020202022757365722d74696d65223a2031372e33312c0a202020202020202022766f6c756e746172792d636f6e746578742d7377697463686573223a2034363431330a2020202020207d2c0a20202020202022313372656c656e67493338362d64656661756c74223a207b0a2020202020202020224255494c44223a2022323032342d30372d32335f32336831336d313773222c0a2020202020202020224255494c54223a202230222c0a2020202020202020224641494c223a202230222c0a2020202020202020224645544348223a202230222c0a20202020202020202249474e4f5245223a202230222c0a2020202020202020224a41494c223a2022313372656c656e6749333836222c0a2020202020202020224c4f4753223a20222f7372632f646174612f6c6f67732f62756c6b2f313372656c656e67493338362d64656661756c742f323032342d30372d32335f32336831336d313773222c0a202020202020202022504f525453223a202264656661756c74222c0a2020202020202020225155455545223a202230222c0a20202020202020202252454d41494e223a202230222c0a202020202020202022534554223a20222d222c0a202020202020202022534b4950223a202230222c0a202020202020202022535441545553223a2022646f6e65222c0a20202020202020202254494d45223a202230222c0a2020202020202020226275696c64223a20302c0a2020202020202020226275696c642d646570656e6473223a20302c0a202020202020202022636865636b2d73616e697479223a20302c0a202020202020202022636865636b73756d223a20302c0a202020202020202022636f6e666967757265223a20302c0a202020202020202022636f70792d6f6e2d77726974652d6661756c7473223a20302c0a2020202020202020226370752d74696d65223a20302c0a202020202020202022646174612d73697a65223a20302c0a202020202020202022656c61707365642d74696d6573223a20302c0a20202020202020202265787472616374223a20302c0a202020202020202022657874726163742d646570656e6473223a20302c0a2020202020202020226665746368223a20302c0a20202020202020202266657463682d646570656e6473223a20302c0a202020202020202022696e766f6c756e746172792d636f6e746578742d7377697463686573223a20302c0a2020202020202020226a6f622d636f6e74726f6c2d636f756e74223a20302c0a2020202020202020226c69622d646570656e6473223a20302c0a2020202020202020226c6f675f73697a655f646f6e65223a20302c0a2020202020202020226c6f675f73697a655f6c6174657374223a20302c0a2020202020202020226c6f675f73697a655f7065725f7061636b616765223a203137393037303639312c0a2020202020202020226c6f67735f6469725f646f6e65223a20222f7372632f646174612f6c6f67732f62756c6b2f313372656c656e67493338362d64656661756c742f323032342d30372d32335f32336831336d3137732f6c6f6773222c0a2020202020202020226c6f67735f6469725f6c6174657374223a20222f7372632f646174612f6c6f67732f62756c6b2f313372656c656e67493338362d64656661756c742f323032342d30372d32335f32336831336d3137732f6c6f6773222c0a2020202020202020226c6f67735f6469725f7065725f7061636b616765223a20222f7372632f646174612f6c6f67732f62756c6b2f313372656c656e67493338362d64656661756c742f6c61746573742d7065722d706b67222c0a2020202020202020226d616a6f722d6661756c7473223a20302c0a2020202020202020226d696e6f722d6661756c7473223a20302c0a2020202020202020227061636b616765223a20302c0a2020202020202020227061636b6167655f73697a655f616c6c223a203737323432303435322c0a2020202020202020227061636b6167655f73697a655f6275696c64696e67223a20302c0a2020202020202020227061636b6167655f73697a655f6c6174657374223a2031393831363638302c0a2020202020202020227061636b616765735f6469725f616c6c223a20222f7372632f646174612f7061636b616765732f313372656c656e67493338362d64656661756c742f2e7265616c5f313732313739343431322f416c6c222c0a2020202020202020227061636b616765735f6469725f6275696c64696e67223a20222f7372632f646174612f7061636b616765732f313372656c656e67493338362d64656661756c742f2e6275696c64696e67222c0a2020202020202020227061636b616765735f6469725f6c6174657374223a20222f7372632f646174612f7061636b616765732f313372656c656e67493338362d64656661756c742f2e7265616c5f313732313739343431322f4c6174657374222c0a2020202020202020227061746368223a20302c0a20202020202020202270617463682d646570656e6473223a20302c0a20202020202020202270657263656e742d637075223a20302c0a20202020202020202270657263656e742d6d656d6f7279223a20302c0a202020202020202022706b672d646570656e6473223a20302c0a202020202020202022726561642d626c6f636b73223a20302c0a20202020202020202272656365697665642d6d65737361676573223a20302c0a202020202020202022727373223a20302c0a20202020202020202272756e2d646570656e6473223a20302c0a20202020202020202273656e742d6d65737361676573223a20302c0a202020202020202022737461636b2d73697a65223a20302c0a2020202020202020227374616765223a20302c0a2020202020202020227377617073223a20302c0a20202020202020202273797374656d2d74696d65223a20302c0a202020202020202022746578742d73697a65223a20302c0a20202020202020202274687265616473223a20302c0a202020202020202022757365722d74696d65223a20302c0a202020202020202022766f6c756e746172792d636f6e746578742d7377697463686573223a20300a2020202020207d0a202020207d2c0a20202020226e6f745f646f6e65223a20312c0a20202020227374617473223a207b0a202020202020224255494c54223a203631392c0a202020202020224641494c223a20312c0a202020202020224645544348223a20302c0a2020202020202249474e4f5245223a20312c0a202020202020225155455545223a203634382c0a2020202020202252454d41494e223a2032322c0a20202020202022534b4950223a20352c0a2020202020202254494d45223a20302c0a202020202020226275696c64223a20312c0a202020202020226275696c642d646570656e6473223a20312c0a20202020202022636865636b2d73616e697479223a20302c0a20202020202022636865636b73756d223a20302c0a20202020202022636f6e666967757265223a20302c0a20202020202022636f70792d6f6e2d77726974652d6661756c7473223a20313237392c0a202020202020226370752d74696d65223a2031382e34332c0a20202020202022646174612d73697a65223a2031313636342c0a20202020202022656c61707365642d74696d6573223a2032303233312c0a2020202020202265787472616374223a20302c0a20202020202022657874726163742d646570656e6473223a20302c0a202020202020226665746368223a20302c0a2020202020202266657463682d646570656e6473223a20302c0a20202020202022696e766f6c756e746172792d636f6e746578742d7377697463686573223a20313031332c0a202020202020226a6f622d636f6e74726f6c2d636f756e74223a20392c0a202020202020226c69622d646570656e6473223a20312c0a202020202020226c6f675f73697a655f646f6e65223a20302c0a202020202020226c6f675f73697a655f6c6174657374223a20302c0a202020202020226c6f675f73697a655f7065725f7061636b616765223a203137393037303639312c0a202020202020226d616a6f722d6661756c7473223a2031312c0a202020202020226d696e6f722d6661756c7473223a2036373137382c0a202020202020227061636b616765223a20302c0a202020202020227061636b6167655f73697a655f616c6c223a203737323432303435322c0a202020202020227061636b6167655f73697a655f6275696c64696e67223a20333638323338352c0a202020202020227061636b6167655f73697a655f6c6174657374223a2031393831363638302c0a202020202020227061746368223a20302c0a2020202020202270617463682d646570656e6473223a20302c0a2020202020202270657263656e742d637075223a20302e312c0a2020202020202270657263656e742d6d656d6f7279223a20302e312c0a20202020202022706b672d646570656e6473223a20302c0a20202020202022726561642d626c6f636b73223a20313435382c0a2020202020202272656365697665642d6d65737361676573223a2032333430332c0a20202020202022727373223a203239363132382c0a2020202020202272756e2d646570656e6473223a20302c0a2020202020202273656e742d6d65737361676573223a2032332c0a20202020202022737461636b2d73697a65223a20313739322c0a202020202020227374616765223a20302c0a202020202020227377617073223a20302c0a2020202020202273797374656d2d74696d65223a20312e31332c0a20202020202022746578742d73697a65223a2033333038302c0a2020202020202274687265616473223a2031342c0a20202020202022757365722d74696d65223a2031372e33312c0a20202020202022766f6c756e746172792d636f6e746578742d7377697463686573223a2034363431332c0a202020202020227772697474656e2d626c6f636b73223a20300a202020207d2c0a2020202022737461747573223a20227465737432220a20207d2c0a2020226572726f72223a202230222c0a2020226572726f72537472696e67223a2022222c0a20202276657273696f6e223a20310a7d0a