From f8aad020f7c0be604da8981663b6d815f94ffaa4 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Wed, 10 Jun 2026 14:49:33 +0200 Subject: Run clang-format on everything once again (#2275) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lorenz Kästle --- plugins/check_nagios.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'plugins/check_nagios.c') diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c index e2f230c9..84506bb4 100644 --- a/plugins/check_nagios.c +++ b/plugins/check_nagios.c @@ -79,7 +79,8 @@ int main(int argc, char **argv) { /* open the status log */ FILE *log_file = fopen(config.status_log, "r"); if (log_file == NULL) { - die(STATE_CRITICAL, "NAGIOS %s: %s\n", _("CRITICAL"), _("Cannot open status log for reading!")); + die(STATE_CRITICAL, "NAGIOS %s: %s\n", _("CRITICAL"), + _("Cannot open status log for reading!")); } unsigned long latest_entry_time = 0L; @@ -153,7 +154,8 @@ int main(int argc, char **argv) { } /* May get empty procargs */ - if (!strstr(procargs, argv[0]) && strstr(procargs, config.process_string) && strcmp(procargs, "")) { + if (!strstr(procargs, argv[0]) && strstr(procargs, config.process_string) && + strcmp(procargs, "")) { proc_entries++; if (verbose >= 2) { printf(_("Found process: %s %s\n"), procprog, procargs); @@ -171,11 +173,13 @@ int main(int argc, char **argv) { alarm(0); if (proc_entries == 0) { - die(STATE_CRITICAL, "NAGIOS %s: %s\n", _("CRITICAL"), _("Could not locate a running Nagios process!")); + die(STATE_CRITICAL, "NAGIOS %s: %s\n", _("CRITICAL"), + _("Could not locate a running Nagios process!")); } if (latest_entry_time == 0L) { - die(STATE_CRITICAL, "NAGIOS %s: %s\n", _("CRITICAL"), _("Cannot parse Nagios log file for valid time")); + die(STATE_CRITICAL, "NAGIOS %s: %s\n", _("CRITICAL"), + _("Cannot parse Nagios log file for valid time")); } time_t current_time; @@ -189,7 +193,8 @@ int main(int argc, char **argv) { printf("NAGIOS %s: ", (result == STATE_OK) ? _("OK") : _("WARNING")); printf(ngettext("%d process", "%d processes", proc_entries), proc_entries); printf(", "); - printf(ngettext("status log updated %d second ago", "status log updated %d seconds ago", (int)(current_time - latest_entry_time)), + printf(ngettext("status log updated %d second ago", "status log updated %d seconds ago", + (int)(current_time - latest_entry_time)), (int)(current_time - latest_entry_time)); printf("\n"); @@ -198,10 +203,11 @@ int main(int argc, char **argv) { /* process command-line arguments */ check_nagios_config_wrapper process_arguments(int argc, char **argv) { - static struct option longopts[] = {{"filename", required_argument, 0, 'F'}, {"expires", required_argument, 0, 'e'}, - {"command", required_argument, 0, 'C'}, {"timeout", optional_argument, 0, 't'}, - {"version", no_argument, 0, 'V'}, {"help", no_argument, 0, 'h'}, - {"verbose", no_argument, 0, 'v'}, {0, 0, 0, 0}}; + static struct option longopts[] = { + {"filename", required_argument, 0, 'F'}, {"expires", required_argument, 0, 'e'}, + {"command", required_argument, 0, 'C'}, {"timeout", optional_argument, 0, 't'}, + {"version", no_argument, 0, 'V'}, {"help", no_argument, 0, 'h'}, + {"verbose", no_argument, 0, 'v'}, {0, 0, 0, 0}}; check_nagios_config_wrapper result = { .errorcode = OK, @@ -285,7 +291,8 @@ void print_help(void) { printf("%s\n", _("This plugin checks the status of the Nagios process on the local machine")); printf("%s\n", _("The plugin will check to make sure the Nagios status log is no older than")); printf("%s\n", _("the number of minutes specified by the expires option.")); - printf("%s\n", _("It also checks the process table for a process matching the command argument.")); + printf("%s\n", + _("It also checks the process table for a process matching the command argument.")); printf("\n\n"); @@ -306,12 +313,14 @@ void print_help(void) { printf("\n"); printf("%s\n", _("Examples:")); - printf(" %s\n", "check_nagios -t 20 -e 5 -F /usr/local/nagios/var/status.log -C /usr/local/nagios/bin/nagios"); + printf(" %s\n", "check_nagios -t 20 -e 5 -F /usr/local/nagios/var/status.log -C " + "/usr/local/nagios/bin/nagios"); printf(UT_SUPPORT); } void print_usage(void) { printf("%s\n", _("Usage:")); - printf("%s -F -t -e -C \n", progname); + printf("%s -F -t -e -C \n", + progname); } -- cgit v1.2.3-74-g34f1