Alerting

How to create an alert that monitors ports 8000, 8089 and 9997 every 5 mins

rrettig
New Member

Hello Folks!

I need to create an alert that that checks if ports 800, 8089 and 9997 are up or down every 5 minutes. Could you please help me out? TIA!

0 Karma

rrettig
New Member

This is what we have right now.

| rest splunk_server=local /services/search/distributed/peers/
| where status="Up" AND disabled=0
| fields peerName, status
| rename peerName as Instance, status as Status

0 Karma

adonio
Ultra Champion

millions of ways to it ...
here is one from top of my head, in linux, create a scripted input that does something like that;
sudo lsof -i -P -n | grep LISTEN <ports numbers ...>
or that
sudo netstat -tulpn | grep LISTEN <ports numbers ...>
in windows same idea ..
netstat -a
take the ouptut to Splunk and search for up or down ...

rrettig
New Member

Is there a way to run a search through Splunk?

0 Karma

adonio
Ultra Champion

yes ... bring the right data, then run your search that captures condition for alert ...

0 Karma

jacobpevans
Motivator

In case it's not clear, you need to apply @adonio 's answer to a scripted input that sends the output to Splunk.

Cheers,
Jacob

If you feel this response answered your question, please do not forget to mark it as such. If it did not, but you do have the answer, feel free to answer your own post and accept that as the answer.
0 Karma

jacobpevans
Motivator

Are you checking a Linux or Windows machine?

Cheers,
Jacob

If you feel this response answered your question, please do not forget to mark it as such. If it did not, but you do have the answer, feel free to answer your own post and accept that as the answer.
0 Karma

rrettig
New Member

Both! We have linux servers and Windows workstations.

0 Karma
Get Updates on the Splunk Community!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...