- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Nagios not sending alerts
Operating System - HP-UX
1753770
Members
5104
Online
108799
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 05:26 PM
тАО03-14-2011 05:26 PM
Nagios not sending alerts
Nagios is sparingly sending alerts, not sure where the problem is, here is what I have done -
1) created generic contact template and contact (in contacts.cfg) called nagios which is also a local user on the box.
define contact{
name generic-contact ; The name of this contact template
service_notification_period 24x7 ; service notifications can be sent anytime
host_notification_period 24x7 ; host notifications can be sent anytime
service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
service_notification_commands notify-service-by-email ; send service notifications via email
host_notification_commands notify-host-by-email ; send host notifications via email
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
}
define contact{
contact_name nagios ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
service_notification_period 24x7
host_notification_period 24x7
service_notification_options u,c
host_notification_options n
service_notification_commands notify-by-email
host_notification_commands notify-host-by-email
email nagios@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
2) within contacts.cfg made it part of admin group -
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagios
}
3) In commands.cfg, created a command to send an alert thru email -
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$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
4) In services.cfg added admins group for notification for each of the service defined -
contact_groups admins
5) added a couple of email ids in /etc/aliases -
nagios tom@xxx.com, harry@xxx.com
6) ran newaliases and nagios process using -v and -d switches and it ran just fine.
Sending alert from the commandline also works.Even I got a few email alerts but not consistently.Location of mail is same as defined above in commands,cfg.
Please help!
Thanks,
Allan
1) created generic contact template and contact (in contacts.cfg) called nagios which is also a local user on the box.
define contact{
name generic-contact ; The name of this contact template
service_notification_period 24x7 ; service notifications can be sent anytime
host_notification_period 24x7 ; host notifications can be sent anytime
service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
service_notification_commands notify-service-by-email ; send service notifications via email
host_notification_commands notify-host-by-email ; send host notifications via email
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
}
define contact{
contact_name nagios ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
service_notification_period 24x7
host_notification_period 24x7
service_notification_options u,c
host_notification_options n
service_notification_commands notify-by-email
host_notification_commands notify-host-by-email
email nagios@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
2) within contacts.cfg made it part of admin group -
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagios
}
3) In commands.cfg, created a command to send an alert thru email -
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$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
4) In services.cfg added admins group for notification for each of the service defined -
contact_groups admins
5) added a couple of email ids in /etc/aliases -
nagios tom@xxx.com, harry@xxx.com
6) ran newaliases and nagios process using -v and -d switches and it ran just fine.
Sending alert from the commandline also works.Even I got a few email alerts but not consistently.Location of mail is same as defined above in commands,cfg.
Please help!
Thanks,
Allan
- Tags:
- nagios
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2011 03:15 PM
тАО03-15-2011 03:15 PM
Re: Nagios not sending alerts
Please help!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2011 03:01 AM
тАО04-22-2011 03:01 AM
Re: Nagios not sending alerts
Hello Allan,
You can add:
define contact{
contact_name tom
...
email tom@xxx.com
}
define contact{
contact_name harry
...
email harry@xxx.com
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagios, tom, harry
}
You can add:
define contact{
contact_name tom
...
email tom@xxx.com
}
define contact{
contact_name harry
...
email harry@xxx.com
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagios, tom, harry
}
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP