summaryrefslogtreecommitdiffstats
path: root/health/health_config.c
AgeCommit message (Expand)Author
2023-01-18Revert health to run in a single thread (#14244)Emmanuel Vasilakis
2023-01-10DBENGINE v2 (#14125)Costa Tsaousis
2022-12-19Add a health configuration option of what alarms to load (#14150)Emmanuel Vasilakis
2022-10-19Health thread per host (#13712)Emmanuel Vasilakis
2022-09-19RRD structures managed by dictionaries (#13646)Costa Tsaousis
2022-09-05Deduplicate all netdata strings (#13570)Costa Tsaousis
2022-08-16Support chart labels in alerts (#13290)Emmanuel Vasilakis
2022-08-11Calculate name hash after rrdvar_fix_name (#13509)Emmanuel Vasilakis
2022-06-28netdata doubles (#13217)Costa Tsaousis
2022-06-13Labels with dictionary (#13070)Costa Tsaousis
2022-05-11Expose anomaly-bit option to health. (#12835)vkalintiris
2022-05-11fix(health): change duplicate health template message logging level to 'info'...Ilya Mashchenko
2022-04-01Fix memory leaks on Netdata exit (#12511)Vladimir Kobal
2022-03-11Only store alert hashes once per health config iteration (#12292)Emmanuel Vasilakis
2022-01-17Add localhost hostname to the edit_command (#11793)Emmanuel Vasilakis
2021-09-21fix coverity (#11535)Emmanuel Vasilakis
2021-09-19Use sqlite to store the health log and alert configurations. (#11399)Emmanuel Vasilakis
2021-05-31Provide UTC offset in seconds and edit health config command (#11051)Emmanuel Vasilakis
2021-04-28Add `charts` to templates (#11054)thiagoftsm
2021-04-23Rename struct fields from class to classification. (#11019)vkalintiris
2021-04-20Provide new attributes in health conf files (#10961)Emmanuel Vasilakis
2021-03-17Rename abs to ABS to avoid clash with standard definitions. Fixes #10353. (#1...Tomáš Kopal
2021-02-11Disable stock alarms (#10617)thiagoftsm
2020-10-20New alarm entities (#10041)thiagoftsm
2020-01-02Adjust alarm labels (#7600)thiagoftsm
2019-12-16Labels issues (#7515)Andrew Moss
2019-09-27Create a template for all dimensions (#6560)thiagoftsm
2019-07-01Easily disable alarms, by persisting the silencers configuration (#6360)thiagoftsm
pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.
2018-12-02added debug statements when loading health config files (#4896)Costa Tsaousis
2018-11-10fixed max interface speed calculation (#4594)Costa Tsaousis
2018-10-23modularize the query api (#4443)Costa Tsaousis
2018-10-15modularized all source code (#4391)Costa Tsaousis
} /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<?php
/**
 * Nextcloud - News
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 */

namespace OCA\News\Command\Updater;

use DateTime;
use OCP\Util;
use OCA\News\Service\StatusService;
use OCA\News\Service\UpdaterService;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class Job extends Command
{
    /**
     * @var StatusService Status service
     */
    private $statusService;

    /**
     * @var UpdaterService Update service
     */
    private $updaterService;

    public function __construct(StatusService $statusService, UpdaterService $updaterService)
    {
        parent::__construct();
        $this->statusService = $statusService;
        $this->updaterService = $updaterService;
    }

    /**
     * @return void
     */
    protected function configure()
    {
        $this->setName('news:updater:job')
            ->addOption(
                'reset',
                null,
                InputOption::VALUE_NONE,
                'If the job should be reset, warning this might lead to issues.'
            )
            ->setDescription('Console API for checking the update job status and to reset it.');
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $reset = (bool) $input->getOption('reset');

        [$major, $minor, $micro] = Util::getVersion();
        
        if ($major < 26) {
            $output->writeln("Error: This only works with Nextcloud 26 or newer.");
            return 1;
        }
        $output->writeln("Checking update Status");
        $date = new DateTime();
        $date->setTimestamp($this->statusService->getUpdateTime());
        $output->writeln("Last Execution was ".$date->format('Y-m-d H:i:s e'));

        if ($reset) {
            $output->writeln("Attempting to reset the job.");
            $this->updaterService->reset();
            $output->writeln("Done, job should execute on next schedule.");
        }
        return 0;
    }
}