Linux file monitoring - how to delete

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
rhaig10695
Posts: 2
Joined: Mon Nov 10, 2014 3:36 pm

Linux file monitoring - how to delete

Post by rhaig10695 »

Hello,

I added a bunch of file monitors on a Linux server and i'd like to delete a few of them. How do I do this and is there a way to delete the data on the server as well?

Thanks!
Ryan
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Linux file monitoring - how to delete

Post by sreinhardt »

You would need to modify the /etc/rsyslog.d/ config files. Depending on how you added those files, you may have lots of individual files or a single file. Deleting data from log server currently needs to be done from the command line and looks like:

Code: Select all

curl -XDELETE 'http://localhost:9200/logstash-*/_all/_query' -d '{
    "query" : {
        "term" : { "host" : "10.0.0.1" }
    }
}'
You would want to change the 10.0.0.1 to the host ip or name you wish to remove. This will output the number of successful and failed removals. One thing to note is that close indeces will not have data removed, they will need to be reopened first.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Linux file monitoring - how to delete

Post by eloyd »

Oh man, that's ugly. Any chance to add index/log management from the GUI? I mean, I love scripting curl requests all day, every day, but that's bound to introduce errors some day.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Linux file monitoring - how to delete

Post by tmcdonald »

I suppose that could be done. I suppose, even, that I could file a feature request for this. I suppose even further it could say something like:

Code: Select all

Feature Request:  Add logserver source removal scripts

Add ability to manage log entries per source, possibly with an auto-generated script that handles the syslog configs and phones home to alert NLS of the removal, similarly to how we offer setup scripts only in reverse.
and it would theoretically have the request ID 4434 in our internal feature requests queue.

Just a thought.
Former Nagios employee
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Linux file monitoring - how to delete

Post by eloyd »

Oh, perchance to dream that there existed such a magical place as that which you describe.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Linux file monitoring - how to delete

Post by tmcdonald »

What a world that would be.

rhaig10695, I have filed a feature request for this. Did the curl solution work for you?
Former Nagios employee
Locked