Nagios Core on Raspberry Pi fails to start

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
rnsimmons
Posts: 5
Joined: Tue Mar 25, 2025 2:59 pm

Nagios Core on Raspberry Pi fails to start

Post by rnsimmons »

I've gone through the manual installation process, whereby I built the users and user groups and compiled the code. Everything was working just fine last night. I then started editing the nagios.cfg file to add additional hosts and host groups. The start failed When I tried reloading Nagios with the additional hosts.

What I see when I run journalctl -xeu nagios.service is

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Nagios Core 4.5.9
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Copyright (c) 1999-2009 Ethan Galstad
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Last Modified: 2024-12-19
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: License: GPL
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Website: https://www.nagios.org
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Reading configuration data...
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Read main config file okay...
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Error: Template 'RaspberryPi' specified in host definition could not be not found (config file '>
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Error: Invalid max_check_attempts value for host 'RaspberryPi42nd'
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Error: Could not register host (config file '/usr/local/nagios/etc/objects/RPi42.cfg', starting >
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Error processing object config files!
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: ***> One or more problems was encountered while processing the config files...
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: Check your configuration file(s) to ensure that they contain valid
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: directives and data definitions. If you are upgrading from a previous
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: version of Nagios, you should be aware that some variables/definitions
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: may have been removed or modified in this version. Make sure to read
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: the HTML documentation regarding the config files, as well as the
Mar 31 13:57:02 raspberrypi42nd nagios[5965]: 'Whats New' section to find out what has changed.
Mar 31 13:57:02 raspberrypi42nd systemd[1]: nagios.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ An ExecStartPre= process belonging to unit nagios.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Mar 31 13:57:02 raspberrypi42nd systemd[1]: nagios.service: Failed with result 'exit-code'.
░░ Subject: Unit failed

░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit nagios.service has entered the 'failed' state with result 'exit-code'.
Mar 31 13:57:02 raspberrypi42nd systemd[1]: Failed to start nagios.service - Nagios Core 4.5.9.
░░ Subject: A start job for unit nagios.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit nagios.service has finished with a failure.
░░
░░ The job identifier is 4034 and the job result is failed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm fairly new to Raspberry Pi OS/Linux and VERY new to Nagios. What do I need to be looking at? What logs might tell me what I did wrong?

Any help is appreciated.
Russell N. Simmons
[email protected]
DoubleDoubleA
Posts: 273
Joined: Thu Feb 09, 2017 5:07 pm

Re: Nagios Core on Raspberry Pi fails to start

Post by DoubleDoubleA »

Hi @rnsimmons,

The output you provided has everything you need to know to understand the error at hand.

Nagios uses a collection of config files to know what to monitor and how. These are text files, and when the Nagios process goes to start up, it reads all the config files and builds data structures in memory where Nagios keeps track of what it is monitoring, whether it is up or down, whether things need to be checked or re-checked, etc. When the config files don't conform to expectations, Nagios can't fill in the blanks correctly, and it ends the process.

The output looks like it points to two separate errors, though they may be in the same config.

First, Nagios thinks you are trying to use a template called RaspberryPi. Did you mean to use a template? If not, that config looks to Nagios like a template.

Second, the value of max_check_attempts is invalid (is it missing?).

Here's a link to the doc on Templates https://assets.nagios.com/downloads/nag ... tance.html , and you might want to take a look through that whole collection of docs from the beginning,

Lastly, can you post your configs? RPi42.cfg would be a good start.

Aaron
rnsimmons
Posts: 5
Joined: Tue Mar 25, 2025 2:59 pm

Re: Nagios Core on Raspberry Pi fails to start

Post by rnsimmons »

I've since uninstalled Nagios and rebuilt it from scratch. However, when I configure it, I get the same issue. I suspected the problem was with a config file as that was what I modified prior to attempting the restart.

BTW, I'm using the instructions from Raspberry Tips by Patrick Fromaget.
Attachments
raspberrypi42nd.cfg
(4.71 KiB) Downloaded 345 times
raspberrypi3b.cfg
(4.71 KiB) Downloaded 366 times
arnesscopihole.cfg
(4.71 KiB) Downloaded 374 times
nagios.cfg
(88.61 KiB) Downloaded 343 times
Russell N. Simmons
[email protected]
rnsimmons
Posts: 5
Joined: Tue Mar 25, 2025 2:59 pm

Re: Nagios Core on Raspberry Pi fails to start

Post by rnsimmons »

I just noticed that there's a nagios.cfg in /usr/local/nagios/etc AND in /usr/local/nagios/etc/objects. I assume the one NOT in objects is the one used when trying to start the Nagios service.

I'm still getting the same error when trying to restart nagios.
Russell N. Simmons
[email protected]
kg2857
Posts: 491
Joined: Wed Apr 12, 2023 5:48 pm

Re: Nagios Core on Raspberry Pi fails to start

Post by kg2857 »

A post above tells you what you can do and how to solve the problem...
Read the words. When it says Error, read.
Try those things.
Post Reply