[Nagios-devel] duplicate command definitions in minimal.cfg

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.
Locked
Guest

[Nagios-devel] duplicate command definitions in minimal.cfg

Post by Guest »


We have this in our rpm specfile to get a working config, based on the
installed -sample files:

...
for i in $RPM_BUILD_ROOT/etc/nagios/*-sample ; do
mv $i ${i%%-sample}
done
cp -vf sample-config/template-object/minimal.cfg \
$RPM_BUILD_ROOT/etc/nagios/minimal.cfg-sample
...

This leads to the errors below. It would be nice if the defaults can
work out of the box. Maybe they could even provide a limited config for
localhost, I havent checked how it could look in practice.



Error: Command 'check-host-alive' has already been defined
Error: Could not register command (config file '/etc/nagios/minimal.cfg', starting on line 76)

Error: Command 'check_local_disk' has already been defined
Error: Could not register command (config file '/etc/nagios/minimal.cfg', starting on line 92)

Error: Command 'check_local_load' has already been defined
Error: Could not register command (config file '/etc/nagios/minimal.cfg', starting on line 117)

Error: Command 'check_local_procs' has already been defined
Error: Could not register command (config file '/etc/nagios/minimal.cfg', starting on line 109)

Error: Command 'check_local_users' has already been defined
Error: Could not register command (config file '/etc/nagios/minimal.cfg', starting on line 101)

Error: Command 'check_ping' has already been defined
Error: Could not register command (config file '/etc/nagios/minimal.cfg', starting on line 84)

Error: Command 'host-notify-by-email' has already been defined
Error: Could not register command (config file '/etc/nagios/minimal.cfg', starting on line 68)

Error: Command 'notify-by-email' has already been defined
Error: Could not register command (config file '/etc/nagios/minimal.cfg', starting on line 59)

---
sample-config/template-object/minimal.cfg.in | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

Index: nagios-2.5/sample-config/template-object/minimal.cfg.in
===================================================================
--- nagios-2.5.orig/sample-config/template-object/minimal.cfg.in
+++ nagios-2.5/sample-config/template-object/minimal.cfg.in
@@ -57,7 +57,7 @@ define timeperiod{
# notifications (about service alerts) to contacts.

define command{
- command_name notify-by-email
+ command_name notify-by-email-disabled
command_line /usr/bin/printf "%b" "***** Nagios @VERSION@ *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | @MAIL_PROG@ -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}

@@ -66,7 +66,7 @@ define command{
# notifications (about host alerts) to contacts.

define command{
- command_name host-notify-by-email
+ command_name host-notify-by-email-disabled
command_line /usr/bin/printf "%b" "***** Nagios @VERSION@ *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | @MAIL_PROG@ -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
}

@@ -74,7 +74,7 @@ define command{
# Command to check to see if a host is "alive" (up) by pinging it

define command{
- command_name check-host-alive
+ command_name check-host-alive-disabled
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 99,99% -c 100,100% -p 1
}

@@ -82,7 +82,7 @@ define command{
# Generic command to check a device by pinging it

define command{
- command_name check_ping
+ command_name check_ping-disabled
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}

@@ -90,7 +90,7 @@ define command{
# Command used to check disk space usage on local partitions

define command{
- command_name check_local_disk
+ command_name check_local_disk-disabled
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}

@@ -99,7 +99,7 @@ define command{
# local machine

define command{
- command_name check_local_users
+ command_name check_local_users-disabled
command_line $USER1$/check_users -w $A

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked