Alerting

Alert for Linux server

Vishal2
Explorer

Can you provide the An example of search query or script. If Linux server is shutdown or down or up. I am looking for the best way to setup an shutdown or down or up status alert for Linux server.

Labels (1)
Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Vishal2,

my hint is to monitor the Splunk Universal Forwarder that takes logs from that server so, when you don't receive Splunk internal logs from that server, you have to intervene because the server is down or there's a problem one the Forwarder or the network that requires yout intervene.

You can monitor a list of hosts (not depending on the operative system) creating a lookup (called e.g. perimeter.csv) contaning only one column (called host) and run a search like the following:

| metasearch index=_internal
| eval host=lower(host)
| stats count BY host
| append [ | inputlookup perimeter.csv | eval host=lower(host), count=0 | fields host count ]
| stats sum(count) AS total BY host
| where total=0

Then you can schedule this search as an alert to run e.g. every five minutes.

Youcan also save this search (without the last row) to display a situation of your infrastructure (total=0 means down, total>0 means up).

Ciao.

Giuseppe

0 Karma

Vishal2
Explorer

Hi,

I know that, you are talking about the logs monitoring but if universal forwarer is failed that time logs not coming to splunk, I don't need that, I need server shutdown or down related query 

 

Is it possible to write the query for Linux server down or shutdown or up ??? If it is possible what is that query ?? 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Vishal2,

the message to search when a server is shutting down is "The system is going down", so you can run something like this:

index=os "The system is going down"

if you have results there was a shutdown, but this doesn't say if the server was still down or not.

In addition , if you don't have the message, it's possible that there was a crash or the Forwarder is down.

For this reason I hint to check the Splunk internal logs.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...