Nagios - Notifications - Not sending - nagios

please help me with Nagios and notifications.
In my service configuration i specify "contacts" . This contact i have specified in contacts.cfg
And there is problem, notifications wont come.
Please help me, why notification does not come to dominik and dominik1 ?
Thank you
There is my host.cfg
define service {
use generic-service
host_name MySERVER
service_description PING
check_command check_ping!100.0,20%!500.0,60%
contacts dominik, dominik2
notification_interval 1
}
There is my contacts.cfg
define contact{
contact_name dominik
use generic-contact
alias Dominik
email dominik#dominik.com
}
define contact{
contact_name dominik1
use generic-contact
alias Dominik1
email dominik1#dominik.com
}
There is my template.cfg
define service{
name generic-service ; The 'name' of this service template
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
is_volatile 0 ; The service is not volatile
check_period 24x7 ; The service can be checked at any time of the day
max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state
normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
retry_check_interval 2 ; Re-check the service every two minutes until a hard state can be determined
# contact_groups admins ; Notifications get sent out to everyone in the 'admins' group
notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
notification_interval 60 ; Re-notify about service problems every hour
notification_period 24x7 ; Notifications can be sent out at any time
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
FOR sure i add also template for generic-contact
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!
}

It might not be about the configurations. Just check if their is an email(SMTP) server up and running on your setup. Or add an external SMTP details in Nagios, so that Nagios would be able to send mails.

Related

Gatling: Handle RequestTimeoutException

How can one handle RequestTimeoutException in Gatling so a scenario doesn't get marked as failed?
I have looked into https://github.com/gatling/gatling/blob/master/gatling-core/src/main/resources/gatling-defaults.conf but couldn't find a corresponding parameter.
You can change timeout in gatling.conf of your project, but I don't think you can make Gatling completely ignore it. I wonder what is the reason behind this goal, cause catching failures and put it in report is smth you are looking for?
If you have chained requests and with timeout the following requests are useless, you can use exitBlockOnFail to stop on failed (time outed)request.
http {
#fetchedCssCacheMaxCapacity = 200 # Cache size for CSS parsed content, set to 0 to disable
#fetchedHtmlCacheMaxCapacity = 200 # Cache size for HTML parsed content, set to 0 to disable
#perUserCacheMaxCapacity = 200 # Per virtual user cache size, set to 0 to disable
#warmUpUrl = "https://gatling.io" # The URL to use to warm-up the HTTP stack (blank means disabled)
#enableGA = true # Very light Google Analytics (Gatling and Java version), please support
#pooledConnectionIdleTimeout = 60000 # Timeout in millis for a connection to stay idle in the pool
requestTimeout = 120000 # Timeout in millis for performing an HTTP request
#enableHostnameVerification = false # When set to true, enable hostname verification: SSLEngine.setHttpsEndpointIdentificationAlgorithm("HTTPS")
dns {
#queryTimeout = 5000 # Timeout in millis of each DNS query in millis
#maxQueriesPerResolve = 6 # Maximum allowed number of DNS queries for a given name resolution
}
This is it: https://i.stack.imgur.com/SaZIq.png
You can tweak it as much as you want.

session timeout in angularjs

Is there any way to manage user session using Angularjs?, I mean::
Session timeout - when system is idle.
Alerts(popup with message do you want to continue (yes or no ) ) when session is near to expire with option to resume session.
Redirect (or any other action) when trying to make a request if session has expired.
and after session timeout user has to be loggedout automatically.
Thanks in advance.
Try ng-idle. It's simple component where you can set the timeout and warning time before the timeout is reached. Then you can query server for user logout or something similar.
myApp.config(function(IdleProvider, KeepaliveProvider) {
IdleProvider.idle(900); // 15 min
IdleProvider.timeout(60);
KeepaliveProvider.interval(600); // heartbeat every 10 min
KeepaliveProvider.http('/api/heartbeat'); // URL that makes sure session is alive
});
myApp.run(function($rootScope, Idle) {
Idle.watch();
$rootScope.$on('IdleStart', function() { /* Display modal warning or sth */ });
$rootScope.$on('IdleTimeout', function() { /* Logout user */ });
});
In the above configuration, when user is idle for 900s (does not move mouse, press any key or button etc), warning is being displayed. It will then wait 60s and log out user (send request to a server that possibly destroys server session).
In order to make sure server session does not expire (even if everything user is doing is moving mouse) the Keepalive service will send a request to the server every 10 minutes. This time has to less than server session expiration time.
Demo Link : http://hackedbychinese.github.io/ng-idle/

How to route incoming call to queue of agents though AGI C Program in Asterisk

I am using AGI in C Language for a basic Call Centre Setup in Asterisk
[PUNDIT]
exten =>92186,1,agi(Pundit/PunditBin)
exten=>92186,2,Hangup
PunditBin is a C application. On receiving the call the app dail Agent SIP URI directly and it works (Agent Phone Rings).
fprintf(stdout,"EXEC Dial SIP/%s,50\n",Free_Pundit);
But the problem is that i have to include the ACD logic in the app itself. However, I want to use Asterisk Queue and ACD mechanism.
I have configured the Asterisk ACD in following manner:-
**queues.conf:-**
[exchat_pundit]
musicclass=default ; play [default] music
strategy=rrmemory ; use the Round Robin Memory strategy
joinempty=no ; do not join the queue when no members available
leavewhenempty=yes ; leave the queue when no members available
ringinuse=no ; don't ring members when already InUse (prevents
context=QueueMemberFunctions
**Extension.conf**
//Moving the call to Queue of agents
[Queues]
exten => 7001,1,Verbose(2,${CALLERID(all)} entering the chat Pundit queue)
same => n,Queue(exchat_pundit)
same => n,Hangup()
[LocalSets]
include => Queues ; allow phones to call queues
//Agent Registration, Pause etc..
[QueueMemberFunctions]
exten => *54,1,Verbose(2,Logging In Queue Member)
same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
same => n,AddQueueMember(exchat_pundit,${MemberChannel})
; ${AQMSTATUS}
; ADDED
; MEMBERALREADY
; NOSUCHQUEUE
exten => *56,1,Verbose(2,Logging Out Queue Member)
same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
same => n,RemoveQueueMember(exchat_pundit,${MemberChannel})
; ${RQMSTATUS}:
; REMOVED
; NOTINQUEUE
; NOSUCHQUEUE
exten => *72,1,Verbose(2,Pause Queue Member)
same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
same => n,PauseQueueMember(exchat_pundit,${MemberChannel})
; ${PQMSTATUS}:
; PAUSED
; NOTFOUND
exten => *87,1,Verbose(2,Unpause Queue Member)
same => n,Set(MemberChannel=${CHANNEL(channeltype)}/${CHANNEL(peername)})
same => n,UnpauseQueueMember(exchat_pundit,${MemberChannel})
; ${UPQMSTATUS}:
; UNPAUSED
; NOTFOUND
**Sip.conf:-**
//Agents
[ABC]
type=friend; 'user' takes incoming calls
secret=welcome ; password for authenticating the user
nat=yes
disallow=all ; Disallow all codecs for this peer or user definition.
allow=speex
allow=gsm
allow=ulaw
allow=alaw
host=dynamic ; what kind of host you are dealing with and the value .dynamic.
context=QueueMemberFunctions; this is what ties up the Asterisk SIP user with the dialplan in
username=ABC; this field specifies the user name for authentication.
regexten=ABC;
[XYZ]
type=friend; 'user' takes incoming calls
secret=welcome ; password for authenticating the user
disallow=all ; Disallow all codecs for this peer or user definition.
allow=speex
allow=gsm
allow=ulaw
allow=alaw
host=dynamic
context=QueueMemberFunctions
username=XYZ;
regexten=XYZ;
Now when i make a call to extension 7001 using a sip phone directly, my call is sent to the agent in round robin manner it works per fine.
Problem is when i dial the extension 7001 from my C code as following, it does not work.
fprintf(stdout,"EXEC Dial 7001,50\n");
I am not able to send the incoming call to queue of agents.
Please help me to resolve the issue.
Regards,
Raghuvendra Kumar
You can use dial with Local channel to dialplan like this
Dial(Local/7001#Queues,,n)
or in AGI
fprintf(stdout,"EXEC Dial \"Local/7001#Queues,50\"\n");

Nagios sending mails on both IDs

not able to define separate contacts for different environments. alert notification is sent on both mail id rather it should be send to only one that i have specified in service and host as well.by
Please help me out.
Without knowing the Configuration, it is hard to guess, but i think you are using some wrong configuration.
It should look like this :
Your hostconfiguration:
define host{
use **host-template**
host_name **hostname**
hostgroups **if you have any**
address **the IP**
contacts **Admin for Host**
}
Your serviceconfiguration (e.g. CPU)
define service{
use service-template-interval-60min
service_description CPU
host_name **hostname**
check_command check_nrpe_var!check_var_load!15,10,5!30,25,20
contacts **Your Admin Contact for Service**
}

where is unique memcache key prefix?

I have installed memcached and drupal module memcache and in linux command line :
-bash-4.1# netstat -tap | grep memcached
tcp 0 0 *:memcache : LISTEN 8431/memcached
tcp 0 0 *:memcache : LISTEN 8431/memcached
Seems like it is listening to IP and Port but now the part where I get it to work with drupal 7.18 so I can see what is going on?
Following these instruction:
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['memcache_key_prefix'] = 'something_unique';
/* note : Replace the "something_unique" in the last line with your own unique memcache key prefix. */
Where do I find "your own unique memcache key prefix"?
The documentation for the module says:
If you want to have multiple Drupal installations share memcached instances, you need to include a unique prefix for each Drupal installation in the $confarray of settings.php:
$conf['memcache_key_prefix'] = 'something_unique';
You need that parameter only if you have more than one Drupal installation using the same memcached instance; in the case there is just a Drupal installation, you don't need it.
As long as you use a different value for each Drupal installation, you can use the value you want. You could also use the domain name (including the sub-domain name).

Resources