problem while doing check configuration in GUI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: problem while doing check configuration in GUI

Post 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.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: problem while doing check configuration in GUI

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: problem while doing check configuration in GUI

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: problem while doing check configuration in GUI

Post 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!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: problem while doing check configuration in GUI

Post by scottwilkerson »

Open the CCM -> Commands
Search for notify
Make sure we don't have 2 named the same thing
Delete any extras
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: problem while doing check configuration in GUI

Post 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$
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: problem while doing check configuration in GUI

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: problem while doing check configuration in GUI

Post 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
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: problem while doing check configuration in GUI

Post by scottwilkerson »

And you have one in the import folder in the following...

/usr/local/nagios/etc/import/misccommands.cfg

This is the problem
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: problem while doing check configuration in GUI

Post by ravish78 »

thank you .Let me try removing it and compile
Locked