I have setup Nagios on one of my VM.
I receive the first alert when a service is Critical. But I do not receive the subsequent alert/email.
Host template config
define host {
name host-template
alias Default server template
check_command check_dummy!0!!!!!!!
max_check_attempts 10
check_interval 5
retry_interval 1
check_period 24x7
event_handler notify-host-by-email
event_handler_enabled 1
process_perf_data 1
contacts user1
notification_interval 10
notification_period 24x7
first_notification_delay 0
notification_options d,u,s,
notifications_enabled 1
_LTERM_LOAD_C 10
_LTERM_LOAD_W 5
_USED_MEM_C 30
_USED_MEM_W 20
_USED_SPACE_C 40
_USED_SPACE_W 30
register 0
}
Host config:
define host {
host_name aaaaa
use bbbbb
alias DEV
display_name DEV
address 11.111.111.111
_KEY xx
_SERVERPORT xx:8082
_SERVERPORTLFAT xx:443
_URL xx:8082
_USER test01
register 1
}
notification_interval is enabled but still i don't see any notifications.
I'm unsure if there is anything that is overriding it.
Because of this:
max_check_attempts 10
Nagios will try 10 more times before send you notification. Try to comment it and check again
Related
I use Nagios Core 4.4.6. I want Nagios to send services email notifications.
I've used notify-host-by-email already and now want to use notify-service-by-email.
If I use 'Send custom service notification' it success. But auto-alerts doesn't work.
templates.cfg
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,$
host_notification_options d,u,r,f,s ; send notifications for all host states, fl$
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 ; DON'T REGISTER THIS DEFINITION - ITS NOT A$
}
define host {
name generic-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 0 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program r$
retain_nonstatus_information 1 ; Retain non-status information across progr$
notification_period 24x7 ; Send host notifications at any time
register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A$
}
define host {
name linux-server ; The name of this host template
use generic-host ; This template inherits other values from t$
check_period 24x7 ; By default, Linux hosts are checked round $
check_interval 5 ; Actively check the host every 5 minutes
retry_interval 1 ; Schedule host check retries at 1 minute in$
max_check_attempts 10 ; Check each Linux host 10 times (max)
check_command check-host-alive ; Default command to check Linux hosts
notification_period workhours ; Linux admins hate to be woken up, so we on$
; Note that the notification_period variable$
; the value that is inherited from the gener$
notification_interval 120 ; Resend notifications every 2 hours
notification_options d,u,r ; Only send notifications for specific host $
contact_groups admins ; Notifications get sent to the admins by de$
register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A$
}
define service {
name generic-service ; The 'name' of thi$
active_checks_enabled 1 ; Active service ch$
passive_checks_enabled 1 ; Passive service c$
parallelize_check 1 ; Active service ch$
obsess_over_service 1 ; We should obsess $
check_freshness 0 ; Default is to NOT$
notifications_enabled 1 ; Service notificat$
event_handler_enabled 1 ; Service event han$
flap_detection_enabled 1 ; Flap detection is$
process_perf_data 1 ; Process performan$
retain_status_information 1 ; Retain status inf$
retain_nonstatus_information 1 ; Retain non-status$
is_volatile 0 ; The service is no$
check_period 24x7 ; The service can b$
max_check_attempts 3 ; Re-check the serv$
check_interval 10 ; Check the service$
retry_interval 2 ; Re-check the serv$
contact_groups admins ; Notifications get$
notification_options w,u,c,r ; Send notification$
notification_interval 60 ; Re-notify about s$
notification_period 24x7 ; Notifications can$
register 0 ; DON'T REGISTER TH$
}
# Local service definition template
# This is NOT a real service, just a template!
define service {
name local-service ; The name of this $
use generic-service ; Inherit default v$
max_check_attempts 4 ; Re-check the serv$
check_interval 5 ; Check the service$
retry_interval 1 ; Re-check the serv$
register 0 ; DONT REGISTER THI$
}
test_server.cfg
define host {
use linux-server
host_name test_server
alias test_server
address 111.111.111.11 ; sample address
notification_interval 5
notification_period 24x7
}
define service {
use local-service ; Name of service template to use
host_name test_server
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service {
use local-service ; Name of service template to use
host_name test_server
service_description SSH
check_command check_ssh
notification_interval 5
}
define service {
use local-service ; Name of service template to use
host_name test_server
service_description HTTP
check_command check_http
notification_interval 5
}
contacts.cfg
define contact {
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact templa$
alias Nagios Admin ; Full name of user
email gmail#gmail.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ****$
}
define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
How can I force nagios to send notification about services alerts?
When we want to replace a local service account for a domain service account. Systematical we have this error (The advanced page cannot be opened) :
https://image.noelshack.com/fichiers/2019/18/5/1556879210-the-server-is-not-operational.png
This is what we try to do :
https://image.noelshack.com/fichiers/2019/18/5/1556879210-service-login.png
https://image.noelshack.com/fichiers/2019/18/5/1556879210-nologo.png
Note that we don't see the logo and all the CN ...
Thank you for your help :)
PS : The machines are in the same domain, they can be ping each other with the IP or DNS Name.
With the help of Gabriel I found the mistake ...
In the DNS Forward Lookup Zone, I have fill two host with the same IP Adress.
AD.domain.com | Host(A) | 10.10.10.10
domain.com | Host(A) | 10.10.10.10
Unfortunatly, only the AD.domain.com was responding and domain.com was not reachable.
I've removed the row for AD.domain.com and now everything works well !
Thank you for your help !
How shall I see all the status messages of a service in nagios xi. I send multiple status messages and the latest message is displayed in the dashboard UI. From where shall I retrieve all the previous messages?
You need define stalking_options directive in your services/hosts definition.
Example:
define service {
service_description Users count
host_name myhost1
use service_standard
check_command check_nrpe_custom!-H myhost1 -c check_user
stalking_options c,w,o,u
}
More info about stalking_options can be found here.
I'm trying to connect my ldap with the geonetwork database but every time I log in it doesn't show the administrator button. Then I check the database and it is empty. I am using GeOrchestra 13.09 in a localhost enviroment, the geoserver and mapfishapp are running well and they log in without a problem.
My config-security.properties is
Core security properties
logout.success.url=/index.html
passwordSalt=secret-hash-salt=
# LDAP Connection Settings
ldap.base.provider.url=ldap://localhost:389
ldap.base.dn=dc=geobolivia,dc=gob,dc=bo
ldap.security.principal=cn=admin,dc=geobolivia,dc=gob,dc=bo
ldap.security.credentials=geobolivia
ldap.base.search.base=ou=users
ldap.base.dn.pattern=uid={0},${ldap.base.search.base}
#ldap.base.dn.pattern=mail={0},${ldap.base.search.base}
# Define if groups and profile information are imported from LDAP. If not, local database is used.
# When a new user connect first, the default profile is assigned. A user administrator can update
# privilege information.
ldap.privilege.import=true
ldap.privilege.export=true
ldap.privilege.create.nonexisting.groups=false
# Define the way to extract profiles and privileges from the LDAP
# 1. Define one attribute for the profile and one for groups in config-security-overrides.properties
# 2. Define one attribute for the privilege and define a custom pattern (use LDAPUserDetailsContextMapperWithPa$
ldap.privilege.pattern=
#ldap.privilege.pattern=CAT_(.*)_(.*)
ldap.privilege.pattern.idx.group=1
ldap.privilege.pattern.idx.profil=2
# 3. Define custom location for extracting group and role (no support for group/role combination) (use LDAPUser$
#ldap.privilege.search.group.attribute=cn
#ldap.privilege.search.group.object=ou=groups
#ldap.privilege.search.group.query=(&(objectClass=posixGroup)(memberUid={0})(cn=EL_*))
#ldap.privilege.search.group.pattern=EL_(.*)
#ldap.privilege.search.privilege.attribute=cn
#ldap.privilege.search.privilege.object=ou=groups
#ldap.privilege.search.privilege.query=(&(objectClass=posixGroup)(memberUid={0})(cn=SV_*))
#ldap.privilege.search.privilege.pattern=SV_(.*)
ldap.privilege.search.group.attribute=cn
ldap.privilege.search.group.object=ou=groups
ldap.privilege.search.group.query=(&(objectClass=posixGroup)(memberUid={1})(cn=EL_*))
ldap.privilege.search.group.pattern=EL_(.*)
ldap.privilege.search.privilege.attribute=cn
ldap.privilege.search.privilege.object=ou=groups
ldap.privilege.search.privilege.query=(&(objectClass=posixGroup)(memberUid={1})(cn=SV_ADMIN))
ldap.privilege.search.privilege.pattern=SV_(.*)
# Run LDAP sync every day at 23:30
# Run LDAP sync every day at 23:30
#ldap.sync.cron=0 30 23 * * ?
ldap.sync.cron=0 * * * * ?
#ldap.sync.cron=0 0/1 * 1/1 * ? *
ldap.sync.startDelay=60000
ldap.sync.user.search.base=${ldap.base.search.base}
ldap.sync.user.search.filter=(&(objectClass=*)(mail=*#*)(givenName=*))
ldap.sync.user.search.attribute=uid
ldap.sync.group.search.base=ou=groups
ldap.sync.group.search.filter=(&(objectClass=posixGroup)(cn=EL_*))
ldap.sync.group.search.attribute=cn
ldap.sync.group.search.pattern=EL_(.*)
# CAS properties
cas.baseURL=https://localhost:8443/cas
cas.ticket.validator.url=${cas.baseURL}
cas.login.url=${cas.baseURL}/login
cas.logout.url=${cas.baseURL}/logout?url=${geonetwork.https.url}/
<import resource="config-security-cas.xml"/>
<import resource="config-security-cas-ldap.xml"/>
# either the hardcoded url to the server
# or if has the form it will be replaced with
# the server details from the server configuration
geonetwork.https.url=https://localhost/geonetwork-private/
#geonetwork.https.url=https://geobolivia.gob.bo:443
#geonetwork.https.url=https://localhost:443
The geonetwork.log shows these results:
2014-03-11 13:41:00,004 DEBUG [geonetwork.ldap] - LDAPSynchronizerJob starting ...
2014-03-11 13:41:00,006 DEBUG [org.springframework.ldap.core.support.AbstractContextSource] - Got Ldap context on server 'ldap://localhost:389/dc=geobolivia,dc=gob,dc=bo'
2014-03-11 13:41:00,008 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'resourceManager'
2014-03-11 13:41:00,026 DEBUG [geonetwork.ldap] - LDAPSynchronizerJob done.
2014-03-11 13:41:26,429 INFO [geonetwork.lucene] - Done running PurgeExpiredSearchersTask. 0 versions still cached.
2014-03-11 13:41:56,430 INFO [geonetwork.lucene] - Done running PurgeExpiredSearchersTask. 0 versions still cached.
and the that appear in the geonetwork.log is
2014-03-11 13:44:06,426 INFO [jeeves.service] - Dispatching : xml.search.keywords
2014-03-11 13:44:06,427 ERROR [jeeves.service] - Exception when executing service
2014-03-11 13:44:06,427 ERROR [jeeves.service] - (C) Exc : java.lang.IllegalArgumentException: The thesaurus external.theme.inspire-service-taxonomy does not exist, there for the query cannot be excuted: 'Query [query=SELECT DISTINCT id,uppc,lowc,broader,spa_prefLabel,spa_note FROM {id} rdf:type {skos:Concept},[{id} gml:BoundedBy {} gml:upperCorner {uppc}],[{id} gml:BoundedBy {} gml:lowerCorner {lowc}],[{id} skos:broader {broader}],[{id} skos:prefLabel {spa_prefLabel} WHERE lang(spa_prefLabel) LIKE "es" IGNORE CASE],[{id} skos:scopeNote {spa_note} WHERE lang(spa_note) LIKE "es" IGNORE CASE] WHERE (spa_prefLabel LIKE "***" IGNORE CASE OR id LIKE "*") LIMIT 35 USING NAMESPACE skos=<http://www.w3.org/2004/02/skos/core#>,gml=<http://www.opengis.net/gml#>, interpreter=KeywordResultInterpreter]'
The version of GeoNetwork currently used in geOrchestra does not show the "administration" button on its first page. You have to fire a search, then in "other actions" menu on the top right, you should be able to get to the administration interface. We know that it is not very intuitive, but it should change in the next months (we recently planned an upgrade of GeoNetwork before the end of the year).
Did you solve it? I think in your config-security.properties, at this place ldap.base.dn.pattern=uid={0},${ldap.base.search.base}
you need to replace {0} with the username typed in the sign-in screen of geonetwork
I have an Oracle 11g XE installed in Ubuntu 12.4 and facing difficulty with getting the Oracle to bind on a TCP port. The IP6 binding seems to be fine but not the IP4 (tcp 0.0.0.0:1521).
Here is the oracle-xe status:
root#pearBox:~# /etc/init.d/oracle-xe status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 06-JUN-2013 15:08:34
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 06-JUN-2013 15:06:42
Uptime 0 days 0 hr. 1 min. 52 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/pearBox/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=pearBox)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=pearBox)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XE" has 1 instance(s).
Instance "XE", status READY, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
Instance "XE", status READY, has 1 handler(s) for this service...
The command completed successfully
Netstat results:
root#pearBox:~# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 914/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1859/apache2
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 608/sshd
tcp6 0 0 :::22447 :::* LISTEN 1757/xe_d000_XE
tcp6 0 0 :::8080 :::* LISTEN 1655/tnslsnr
tcp6 0 0 :::1521 :::* LISTEN 1655/tnslsnr
tcp6 0 0 :::22 :::* LISTEN 608/sshd
And the listener configuration:
root#pearBox:~# cat /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
# listener.ora Network Configuration File:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = pearBox)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
I changed the hostname to "HOST = 127.0.0.1" and it is binding on localhost, but I am not able to access the Oracle instance from the network!
root#pearBox:~# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 914/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1859/apache2
tcp 0 0 127.0.0.1:1521 0.0.0.0:* LISTEN 2339/tnslsnr
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 608/sshd
tcp6 0 0 :::21121 :::* LISTEN 2443/xe_d000_XE
tcp6 0 0 :::22
I would appreciate if you could help to get this issue resolved.
Just found this post, I had the same issue. It was the result of changing my hostname post-installation. I was able to remedy the situation by updating the hostname in both:
/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora
and
/u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
I would suggest to take a look on the firewall rules -> https://help.ubuntu.com/12.04/serverguide/firewall.html
Changing the hostname worked for me as I found a mismatch by checking:
uname -a
listener log : log.xml
/etc/hosts
I added the full host name with the domain
Appreciated the help as I've been searching internet posts for a week before I got this reference.