Determining which Alerts are Disabled because of User Action
-
MikeMAN987
- Posts: 58
- Joined: Fri Sep 29, 2017 9:57 am
Determining which Alerts are Disabled because of User Action
Hi All,
I wanted to ask if there was a way to determine from either the configuration files or another way to find out all services/hosts that have notifications disabled due to user action and not a template? I know i can look back on the audit log and find out what action was taken (we use this often for historical items), however we have lots of servers that we are monitoring and NOT alerting on by default (i.e our test/rd environments where we simply want to capture data) as the template disables the alerting, so without a way to find which ones were user initiated it would be a lot (11,000+ checks) to sift through.
Thanks for any insight!!
Regards,
Mike
I wanted to ask if there was a way to determine from either the configuration files or another way to find out all services/hosts that have notifications disabled due to user action and not a template? I know i can look back on the audit log and find out what action was taken (we use this often for historical items), however we have lots of servers that we are monitoring and NOT alerting on by default (i.e our test/rd environments where we simply want to capture data) as the template disables the alerting, so without a way to find which ones were user initiated it would be a lot (11,000+ checks) to sift through.
Thanks for any insight!!
Regards,
Mike
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Determining which Alerts are Disabled because of User Ac
Hi Mike,
Let me know if you have any other questions.
The audit log provides a record of changes to the system such as changes to which host or template, but not that level of detail. However, if it helps, you can query the database to determine which hosts or services have notifications enabled or disabled. The configuration is stored in the nagiosql database.I wanted to ask if there was a way to determine from either the configuration files or another way to find out all services/hosts that have notifications disabled due to user action and not a template?
Let me know if you have any other questions.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
SteveBeauchemin
- Posts: 524
- Joined: Mon Oct 14, 2013 7:19 pm
Re: Determining which Alerts are Disabled because of User Ac
If you want to start from this point going forward, you could monitor your log file.
I just started doing this so it is fresh in my mind. I am concerned about turning off notifications, which is permanent, versus Ack'ing alerts which makes more sense as it clears itself after recovery. So I started using a plugin to keep an eye on the log.
From the consol labs site I found check_logfiles and found it to be very useful.
This config file can be tailored to get emails when someone does the bad thing.
In my case I actually grab the emails and feed the items I care about to a database so I can open a web page on it.
Service Config Name
Description
Check Command
nrpe ini entry
I hope this helps.
Steve B
I just started doing this so it is fresh in my mind. I am concerned about turning off notifications, which is permanent, versus Ack'ing alerts which makes more sense as it clears itself after recovery. So I started using a plugin to keep an eye on the log.
From the consol labs site I found check_logfiles and found it to be very useful.
This config file can be tailored to get emails when someone does the bad thing.
Code: Select all
$options = 'report=long';
$scriptpath = '/bin';
$protocolretention = '3';
$postscript = 'mailx';
$postscriptparams = '-s Nagios_Audit nagiosalerts@<your-email>.com < $CL_PROTOCOLFILE$';
@searches = ({
tag => 'audit',
logfile => '/usr/local/nagiosxi/var/components/auditlog.log',
criticalpatterns => [
'Pattern is Critical', # place holder
],
warningpatterns => [
#'Pattern is Warning', # place holder
#'ACKNOWLEDGE', # Ack a Service of Host issue
'NOTIFICATIONS', # Nagios Notification disabled or enabled
#'FORCED', # Nagios Force a check to run
#'asqueraded', # User is Masquerading
#'applied a new configuration', # Updated the Configuration
#'account has not been setup', # User login attempt but has no account
#'nvalid username or password', # User login attempt failure
#'ser logged out', # User manually logged out
],
okpatterns => [
'Pattern is Okay', # This will override previous critical or warning matches - place holder
],
criticalexceptions => [
'Pattern is not Critical after all', # This was seen as critical but is not - place holder
],
warningexceptions => [
'Pattern is not Warning after all', # This was seen as warning but is not - place holder
],
options => 'noperfdata',
});
Service Config Name
Code: Select all
svc-NRPE-Linux-Check-Logfile-Scrape-Nagios_AuditCode: Select all
Check_Log_Nagios_AuditCode: Select all
/usr/local/nagios/libexec/check_nrpe --unknown-timeout --timeout 120:3 --host $HOSTADDRESS$ --command $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$Code: Select all
$ARG1$ = check_logfiles
$ARG2$ = -a nagios-auditlog.cfgCode: Select all
command[check_logfiles]=/usr/local/nagios/libexec/check_logfiles.pl --config /usr/local/nagios/libexec/cfg.d/$ARG1$ $ARG2$Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Determining which Alerts are Disabled because of User Ac
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
MikeMAN987
- Posts: 58
- Joined: Fri Sep 29, 2017 9:57 am
Re: Determining which Alerts are Disabled because of User Ac
Thank you all for the help.
-
MikeMAN987
- Posts: 58
- Joined: Fri Sep 29, 2017 9:57 am
Re: Determining which Alerts are Disabled because of User Ac
Where is the default location on the filesystem for the audit log? I read the documentation and can only see it in the Web UI.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Determining which Alerts are Disabled because of User Ac
Hi Mike,
The audit log is stored in the xi_auditlog table in the nagiosxi database. The following command will pull everything from the audit log if you'd like to output this to a file.
Let me know if you have any other questions.
The audit log is stored in the xi_auditlog table in the nagiosxi database. The following command will pull everything from the audit log if you'd like to output this to a file.
Code: Select all
echo "SELECT * FROM xi_users\G;" | mysql -uroot -pnagiosxi nagiosxi
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
SteveBeauchemin
- Posts: 524
- Joined: Mon Oct 14, 2013 7:19 pm
Re: Determining which Alerts are Disabled because of User Ac
Admin tab > System Settings > General tab > at the bottom you will see "Write Audit Log to file:"
And a location.
Steve B
And a location.
Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Determining which Alerts are Disabled because of User Ac
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
MikeMAN987
- Posts: 58
- Joined: Fri Sep 29, 2017 9:57 am
Re: Determining which Alerts are Disabled because of User Ac
Thank you both! Feel free to lock/close this one.