OK either I'm not getting what you are asking or you are not getting what I am replying with, so I'll break it down.
As previously posted by 'internstudent', your contact object definitions (often defined in v3 in contacts.cfg) specify your notification commands. If you have installed nagios by following the quickstart guides, there are default email notification definitions included, like
notify-service-by-email **and **notify-host-by-email are command objects (defined in v3 in commands.cfg) and may look something like this:
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$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
This example uses /bin/mail to send email out to your $CONTACTEMAIL$ as specified in the contact object definition via sendmail. You then need to configure sendmail (for example, or your whatever your own chosen mail server) with whatever it needs to send emails - in this case that involves editing sendmail.mc with the appropriate LOCAL_DOMAIN, SMART_HOST, MASQUERADE features etc etc (theres plenty of information for this available on the web) and then running a make command to apply the changes.
[blockquote]I just want to know where should i add the statement about configuring the mail server.[/blockquote]
So, to answer literally in terms of 'Nagios', the answer is nowhere - configuring your mailserver is done outside of nagios and is nothing to do with nagios. How and where you configure your mailserver depends on what your mailserver application is. If it is sendmail, then it is as I have indicated above, if it is another application, then you will need to refer to the application's readme file. The only thing you configure in nagios is the "notify" command objects, which point to your mail server application, and again I've indicated how this is done above.
Hopefully this has made things a little clearer, more information can be found in the notifications section of the documentation, nagios.sourceforge.net/docs/3_0/ ... tions.html