Page 2 of 2
Re: problem while doing check configuration in GUI
Posted: Tue Sep 04, 2012 9:19 am
by ravish78
define contact {
contact_name rforte-notify
alias Rod J Forte (Notify)
email
[email protected]
use ,,
}
I deleted the 5th line use " manualy and while importing again i am getting the same error.
Re: problem while doing check configuration in GUI
Posted: Tue Sep 04, 2012 9:33 am
by ravish78
define contact {
contact_name rforte-notify
alias Rod J Forte (Notify)
email
[email protected]
use ,,
}
tried removing 5th line use " manually but after that when we import the file we are getting same error
Re: problem while doing check configuration in GUI
Posted: Tue Sep 04, 2012 12:54 pm
by lmiltchev
Are you trying to modify the config manually? In Nagios XI you must use the Core Config Manager.
Go to the Core Config Manager->Contacts->rforte-notify->Modify, fill in all of the required info, and click on "Save". Don't Apply Configuration, yet.
Go to the Core Config Manager->Tools->Write Config Files, click on four "Go" buttons to verify your configs. If you don't have any errors, Apply Configuration.
Hope this helps.
Re: problem while doing check configuration in GUI
Posted: Wed Sep 05, 2012 2:46 pm
by ravish78
Thank you very much .I could modify that in GUI CCM.
Now i am getting this error.Though I did not find any duplicate entries for it to clear.
Warning: Duplicate definition found for command 'host-notify-by-email' (config file '/usr/local/nagios/etc/commands.cfg', starting on line 639)
Error: Could not add object property in file '/usr/local/nagios/etc/commands.cfg' on line 640.
Error processing object config files!
Re: problem while doing check configuration in GUI
Posted: Wed Sep 05, 2012 4:56 pm
by scottwilkerson
Open the CCM -> Commands
Search for notify
Make sure we don't have 2 named the same thing
Delete any extras
Re: problem while doing check configuration in GUI
Posted: Thu Sep 06, 2012 10:22 am
by ravish78
we do not have any duplicate entries in that for host-notify-by-email.
define command {
command_name host-notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
}
define command {
command_name host-notify-by-epager
command_line /usr/bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$
}
define command {
command_name notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
define command {
command_name notify-by-epager
command_line /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
Re: problem while doing check configuration in GUI
Posted: Thu Sep 06, 2012 1:36 pm
by scottwilkerson
Lets run the write config tool top 3 buttons
Configure -> CCM -> Tools -> Write Config tool
After getting the error, go to ssh console for your xi server and run
Code: Select all
grep -r "host-notify-by-email" /usr/local/nagios/etc/
Report the output
Re: problem while doing check configuration in GUI
Posted: Tue Sep 11, 2012 9:12 am
by ravish78
Here is the output of the command attached.
Could see only one entry for in commands.cfg file
/usr/local/nagios/etc/commands.cfg: command_name host-notify-by-email
Re: problem while doing check configuration in GUI
Posted: Tue Sep 11, 2012 11:05 am
by scottwilkerson
And you have one in the import folder in the following...
/usr/local/nagios/etc/import/misccommands.cfg
This is the problem
Re: problem while doing check configuration in GUI
Posted: Tue Sep 11, 2012 1:06 pm
by ravish78
thank you .Let me try removing it and compile