Page 1 of 1

Hostname in NLS Alerts

Posted: Mon Aug 10, 2020 7:16 am
by vravikumar
Dear All

Trying with trial version of NLS on local env't. Able to add couple of servers to NLS and can see logs at one place.

Tried configuring email alert for some sample strings and but received email is not clear.

We able to find hostname in the message i.e. on which server logs it did appear?

Is there anyway to configure alerts to include the hostname in the email notification either in subject or body?

Below is the sample alert that i have received.

SomeRandomError returned with a CRITICAL state at Tue, 28 Jul 2020 10:56:11 +0530

The alert was processed with the following thresholds:

Lookback period: 60s
Warning: 1
Critical: 5
Here is the full alert output:

CRITICAL: 1441 matching entries found |logs=1441;1;5
See the last 60s in the Nagios Log Server dashboard.

Nagios Log Server

Re: Hostname in NLS Alerts

Posted: Mon Aug 10, 2020 4:40 pm
by scottwilkerson
You should be able to add any of the following macros, but there isn't a specific way to just get the hostname

%uniquehosts%
A newline separated list of unique hosts in the alert query.
Example:
192.68.1.5 (28)
192.168.5.112 (1220)
The value inside the parentheses is the amount of matching logs for the alert time period for the hosts.

%lastalertlog%
The last log from the alert query.

%last10alertlogs%
The last 10 logs from the alert query.

Can only use one of %lastalertlog% OR %last10alertlogs%s per email.

Re: Hostname in NLS Alerts

Posted: Mon Aug 17, 2020 1:57 am
by vravikumar
Thank you @scottwilkerson

I have updated my email template to include uniquehost in the mail.

Now i am getting unique ip in the mail instead of host name, is there anyway to get FQDN or host names in mail instead of the IP?

Thanks in advance,
BR,
Ravi Kumar.

Re: Hostname in NLS Alerts

Posted: Mon Aug 17, 2020 7:38 am
by scottwilkerson
vravikumar wrote:is there anyway to get FQDN or host names in mail instead of the IP?
Unfortunately this is not available at this time

Re: Hostname in NLS Alerts

Posted: Wed Aug 19, 2020 6:20 am
by vravikumar
Dear @scottwilkerson

Thanks for your quick response.

I have some additional queries as well.

Can we get the log file name or input module name in the alert email i.e. from which module/log file we have received the error string?

Re: Hostname in NLS Alerts

Posted: Wed Aug 19, 2020 7:44 am
by scottwilkerson
The only way to get these would be if they are contained in the %lastalertlog% macro. this is the most verbose macro