Alerting

How to setup email alerts when linux servers are 80% full?

mike000
New Member

As always I know you will be able to answer my question.
So using this query:

index=_nix_xxxx sourcetype=df host=abdhw003 OR host=n OR host=n OR host=n or host=n MountedOn="/doc"
 | eval TotalGBytes= TotalMBytes/1024 | eval UsedGBytes=UsedMbytes/1024 |eval used_pct=100(UsedGBytes/TotalGBytes) 
 | stats max(TotalGBytes) as "MaxSize(GB) max(UsedGBytes) as "UsedSize(GB) as "percentUsed" by host, MountedOn 
 | search PercentUsed>05| Sort PercentUsed

I am able to see the space used by each server, is there a way wherein the dashboard once any server hits 80% or 90% used- the color of that server changes to red and an email is triggered to the support team that a certain server has reached 90% capacity?

Is that a query or something to be parameterized in the dashboard itself? Trying to understand Splunk, I appreciate all the help.

Thanks,
Mike

Labels (2)
0 Karma

woodcock
Esteemed Legend

Something like this:

index="_nix_xxxx " AND sourcetype="df" 
| stats avg(PercentUsedSpace) AS avgPctUsed BY host Filesystem 
| eval threshold = case( 
   match(Filesystem, "foo"), 85, 
   ...
   true(), 90) 
| where avgPctUsed > threshold
| sort 0 - avgPctUsed 
0 Karma

mike000
New Member

Hi woodcock, thanks for your reply. If I may ask, What will this do? Does this part just change the color or send email trigger? I cant see either in the snippet.

0 Karma

woodcock
Esteemed Legend

Just save it as an alert, add the alert action of email, done.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...