diff --git a/ardumont/munin/softwareheritage_indexer b/ardumont/munin/softwareheritage_indexer new file mode 100755 index 0000000..d017b54 --- /dev/null +++ b/ardumont/munin/softwareheritage_indexer @@ -0,0 +1,84 @@ +#!/usr/bin/perl +# -*- cperl -*- +# +# Copyright (C) 2015 Nicolas Dandrimont +# 2016 Stefano Zacchiroli +# 2018 Antoine R. Dumont (@ardumont) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; version 2 dated June, +# 1991. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. + +=head1 NAME + +softwareheritage_indexer - Plugin to monitor the number of Softwareheritage indexer counter status + +=head1 CONFIGURATION + +Configuration is done through libpq environment variables, for example +PGUSER, PGDATABASE, etc. For more information, see L. + +=head1 SEE ALSO + +L + +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf suggest + +=head1 AUTHOR + +Stefano Zacchiroli + +=head1 COPYRIGHT/License + +Nicolas Dandrimont + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the terms of the GNU General +Public License as published by the Free Software Foundation; version 2 +dated June, 1991. + +=cut + +use strict; +use warnings; + +use Munin::Plugin::Pgsql; + +# Pre-requisite: +# root@somerset:~# cat /etc/munin/plugin-conf.d/softwareheritage +# [softwareheritage-indexer] +# user postgres +# env.PGUSER postgres +# env.PGPORT 5434 + + +my $pg = Munin::Plugin::Pgsql->new( + defaultdb => 'softwareheritage-indexer', + category => 'SoftwareHeritage', + title => 'Software Heritage Indexer Counter', + info => 'Count the Indexer scheduled in Software Heritage Indexer database', + vlabel => 'Indexer Type', + basequery => "(select 'mimetype' as nature, count(*) from content_mimetype union select 'fossology_license' as nature, count(*) from content_fossology_license)", + configquery => "VALUES + ('mimetype', 'Mimetype'), + ('fossology_license', 'Fossology License') + ", + base => 1000000, + extraconfig => 'graph_args --step 3600 --lower-limit 2000000000', +); + +$pg->Process(); diff --git a/ardumont/munin/softwareheritage_scheduler b/ardumont/munin/softwareheritage_scheduler new file mode 100755 index 0000000..49c920e --- /dev/null +++ b/ardumont/munin/softwareheritage_scheduler @@ -0,0 +1,99 @@ +#!/usr/bin/perl +# -*- cperl -*- +# +# Copyright (C) 2015 Nicolas Dandrimont +# 2016 Stefano Zacchiroli +# 2018 Antoine R. Dumont (@ardumont) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; version 2 dated June, +# 1991. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. + +=head1 NAME + +softwareheritage_scheduler - Plugin to monitor the number of scheduled tasks for the softwareheritage archive. + +=head1 CONFIGURATION + +Configuration is done through libpq environment variables, for example +PGUSER, PGDATABASE, etc. For more information, see L. + +=head1 SEE ALSO + +L + +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf suggest + +=head1 AUTHOR + +Stefano Zacchiroli + +=head1 COPYRIGHT/License + +Nicolas Dandrimont + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the terms of the GNU General +Public License as published by the Free Software Foundation; version 2 +dated June, 1991. + +=cut + +use strict; +use warnings; + +use Munin::Plugin::Pgsql; + +my $pg = Munin::Plugin::Pgsql->new( + defaultdb => 'softwareheritage-scheduler', + category => 'SoftwareHeritage', + title => 'Software Heritage Scheduled tasks', + info => 'Count the scheduled tasks in the Software Heritage Scheduler database', + vlabel => 'scheduled tasks', + basequery => "select type ||' '|| policy ||' '|| status as type_policy_status, count(*) as count from task group by 1 order by 1", + configquery => "VALUES + ('load_deb_package_oneshot_completed', 'Deb ld oneshot completed'), + ('load_deb_package_oneshot_disabled', 'Deb ld oneshot disabled'), + ('load_deb_package_oneshot_next_run_scheduled', 'Deb ld oneshot scheduled'), + ('origin_load_archive_hg_oneshot_disabled', 'Hg ld oneshot disabled'), + ('origin_load_archive_hg_oneshot_next_run_scheduled', 'Hg ld oneshot scheduled'), + ('origin_update_git_oneshot_completed', 'Git ld oneshot completed'), + ('origin_update_git_oneshot_disabled', 'Git ld oneshot disabled'), + ('origin_update_git_oneshot_next_run_not_scheduled', 'Git ld oneshot not scheduled'), + ('origin_update_git_oneshot_next_run_scheduled', 'Git ld oneshot scheduled'), + ('origin_update_git_recurring_disabled', 'Git ld recurring disabled'), + ('origin_update_git_recurring_next_run_not_scheduled', 'Git ld recurring not scheduled'), + ('origin_update_git_recurring_next_run_scheduled', 'Git ld recurring scheduled'), + ('swh_deposit_archive_checks_oneshot_disabled', 'Deposit check oneshot disabled'), + ('swh_deposit_archive_checks_oneshot_next_run_scheduled', 'Deposit check oneshot scheduled'), + ('swh_deposit_archive_loading_oneshot_disabled', 'Deposit ld oneshot disabled'), + ('swh_deposit_archive_loading_oneshot_next_run_scheduled', 'Deposit ld oneshot scheduled'), + ('swh_lister_debian_recurring_next_run_not_scheduled', 'Deb lst recurring not scheduled'), + ('swh_lister_debian_recurring_next_run_scheduled', 'Deb lst recurring scheduled'), + ('swh_lister_github_full_recurring_next_run_not_scheduled', 'Full Ghb lst recurring not scheduled'), + ('swh_lister_github_incremental_recurring_next_run_not_scheduled', 'Inc Ghb lst recurring not scheduled'), + ('swh_vault_batch_cooking_oneshot_completed', 'Vault batch cook oneshot completed'), + ('swh_vault_batch_cooking_oneshot_disabled', 'Vault batch cook oneshot disabled'), + ('swh_vault_batch_cooking_oneshot_next_run_not_scheduled', 'Vault batch cook oneshot not scheduled'), + ('swh_vault_batch_cooking_oneshot_next_run_scheduled', 'Vault batch cook oneshot scheduled'), + ('swh_vault_cooking_oneshot_disabled', 'Vault cook oneshot disabled') + ", + stack => 0, + graphmin => 0, +); + +$pg->Process(); diff --git a/ardumont/munin/softwareheritage_scheduler_oneshot b/ardumont/munin/softwareheritage_scheduler_oneshot new file mode 100755 index 0000000..22bb84f --- /dev/null +++ b/ardumont/munin/softwareheritage_scheduler_oneshot @@ -0,0 +1,92 @@ +#!/usr/bin/perl +# -*- cperl -*- +# +# Copyright (C) 2015 Nicolas Dandrimont +# 2016 Stefano Zacchiroli +# 2018 Antoine R. Dumont (@ardumont) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; version 2 dated June, +# 1991. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. + +=head1 NAME + +softwareheritage_scheduler_oneshot - Plugin to monitor the number of scheduled tasks for the softwareheritage archive. + +=head1 CONFIGURATION + +Configuration is done through libpq environment variables, for example +PGUSER, PGDATABASE, etc. For more information, see L. + +=head1 SEE ALSO + +L + +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf suggest + +=head1 AUTHOR + +Stefano Zacchiroli + +=head1 COPYRIGHT/License + +Nicolas Dandrimont + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the terms of the GNU General +Public License as published by the Free Software Foundation; version 2 +dated June, 1991. + +=cut + +use strict; +use warnings; + +use Munin::Plugin::Pgsql; + +my $pg = Munin::Plugin::Pgsql->new( + defaultdb => 'softwareheritage-scheduler', + category => 'SoftwareHeritage', + title => 'Software Heritage Scheduled Oneshot Tasks', + info => 'Count the scheduled oneshot tasks in the Software Heritage Scheduler database', + vlabel => 'scheduled tasks', + basequery => "select type ||' '|| status as type_policy_status, count(*) as count from task where policy='oneshot' group by 1 order by 1", + configquery => "VALUES + ('load_deb_package_completed', 'Deb ld oneshot completed'), + ('load_deb_package_disabled', 'Deb ld oneshot disabled'), + ('load_deb_package_next_run_scheduled', 'Deb ld oneshot scheduled'), + ('origin_load_archive_hg_disabled', 'Hg ld oneshot disabled'), + ('origin_load_archive_hg_next_run_scheduled', 'Hg ld oneshot scheduled'), + ('origin_update_git_completed', 'Git ld oneshot completed'), + ('origin_update_git_disabled', 'Git ld oneshot disabled'), + ('origin_update_git_next_run_not_scheduled', 'Git ld oneshot not scheduled'), + ('origin_update_git_next_run_scheduled', 'Git ld oneshot scheduled'), + ('swh_deposit_archive_checks_disabled', 'Deposit check oneshot disabled'), + ('swh_deposit_archive_checks_next_run_scheduled', 'Deposit check oneshot scheduled'), + ('swh_deposit_archive_loading_disabled', 'Deposit ld oneshot disabled'), + ('swh_deposit_archive_loading_next_run_scheduled', 'Deposit ld oneshot scheduled'), + ('swh_vault_batch_cooking_completed', 'Vault batch cook oneshot completed'), + ('swh_vault_batch_cooking_disabled', 'Vault batch cook oneshot disabled'), + ('swh_vault_batch_cooking_next_run_not_scheduled', 'Vault batch cook oneshot not scheduled'), + ('swh_vault_batch_cooking_next_run_scheduled', 'Vault batch cook oneshot scheduled'), + ('swh_vault_cooking_disabled', 'Vault cook oneshot disabled') + ", + stack => 0, + graphmin => 0, +); + +$pg->Process(); diff --git a/ardumont/munin/softwareheritage_scheduler_recurring b/ardumont/munin/softwareheritage_scheduler_recurring new file mode 100755 index 0000000..382a73a --- /dev/null +++ b/ardumont/munin/softwareheritage_scheduler_recurring @@ -0,0 +1,81 @@ +#!/usr/bin/perl +# -*- cperl -*- +# +# Copyright (C) 2015 Nicolas Dandrimont +# 2016 Stefano Zacchiroli +# 2018 Antoine R. Dumont (@ardumont) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; version 2 dated June, +# 1991. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. + +=head1 NAME + +softwareheritage_scheduler_recurring - Plugin to monitor the number of scheduled tasks for the softwareheritage archive. + +=head1 CONFIGURATION + +Configuration is done through libpq environment variables, for example +PGUSER, PGDATABASE, etc. For more information, see L. + +=head1 SEE ALSO + +L + +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf suggest + +=head1 AUTHOR + +Stefano Zacchiroli + +=head1 COPYRIGHT/License + +Nicolas Dandrimont + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the terms of the GNU General +Public License as published by the Free Software Foundation; version 2 +dated June, 1991. + +=cut + +use strict; +use warnings; + +use Munin::Plugin::Pgsql; + +my $pg = Munin::Plugin::Pgsql->new( + defaultdb => 'softwareheritage-scheduler', + category => 'SoftwareHeritage', + title => 'Software Heritage Scheduled Recurring Tasks', + info => 'Count the recurring scheduled tasks in the Software Heritage Scheduler database', + vlabel => 'recurring scheduled tasks', + basequery => "select type ||' '|| status as type_policy_status, count(*) as count from task where policy='recurring' group by 1 order by 1;", + configquery => "VALUES + ('origin_update_git_disabled', 'Git ld recurring disabled'), + ('origin_update_git_next_run_not_scheduled', 'Git ld recurring not scheduled'), + ('origin_update_git_next_run_scheduled', 'Git ld recurring scheduled'), + ('swh_lister_debian_next_run_not_scheduled', 'Deb lst recurring not scheduled'), + ('swh_lister_debian_next_run_scheduled', 'Deb lst recurring scheduled'), + ('swh_lister_github_full_next_run_not_scheduled', 'Full Ghb lst recurring not scheduled'), + ('swh_lister_github_incremental_next_run_not_scheduled', 'Inc Ghb lst recurring not scheduled'), + ", + stack => 0, + graphmin => 0, +); + +$pg->Process();