Xymon Mailing List Archive search

drop multiple hosts with wildcard

6 messages in this thread

list Kris Springer · Tue, 22 Jan 2019 10:57:44 -0700 ·
Is there a way to drop all host data for multiple hosts using a wildcard?  I know how to drop a single host and erase it's data, but I have a long list of IP Cameras that I changed in my hosts file and instead of dropping each individual hostname I'd like to drop all hosts that start with 'Cam'.  I attempted this but it didn't remove anything.

./xymon 127.0.0.1 "drop Cam*"

-- 

Kris Springer
list Galen Johnson · Tue, 22 Jan 2019 13:05:04 -0500 ·
probably need to use a quick command line 'for' loop.  Something like:

for Host in Cam{1..12}; do
./xymon 127.0.0.1 "drop $Host"
done

You also want to remove the other history info as well but I'd have to go
find that.

=G=

On Tue, Jan 22, 2019 at 12:57 PM Kris Springer <user-c2caa0a7a8d5@xymon.invalid>
quoted from Kris Springer
wrote:
Is there a way to drop all host data for multiple hosts using a
wildcard?  I know how to drop a single host and erase it's data, but I
have a long list of IP Cameras that I changed in my hosts file and
instead of dropping each individual hostname I'd like to drop all hosts
that start with 'Cam'.  I attempted this but it didn't remove anything.

./xymon 127.0.0.1 "drop Cam*"

--

Kris Springer

list John Thurston · Tue, 22 Jan 2019 09:06:36 -0900 ·
quoted from Kris Springer
On 1/22/2019 8:57 AM, Kris Springer wrote:
Is there a way to drop all host data for multiple hosts using a wildcard?  I know how to drop a single host and erase it's data, but I have a long list of IP Cameras that I changed in my hosts file and instead of dropping each individual hostname I'd like to drop all hosts that start with 'Cam'.  I attempted this but it didn't remove anything.

./xymon 127.0.0.1 "drop Cam*"
No. You can't use wild cards here. It's dangerous to even think about it.

In our installation, I've written a couple of wrapper scripts which accept multiple host-names as parameters and loop through them. As a one-off, you can do

for i in foo bar baz; do ./xymon 127.0.0.1 "drop $i"; done

--
    Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Department of Administration
State of Alaska
list Kris Springer · Tue, 22 Jan 2019 11:17:38 -0700 ·
Ok, let me ask the question a little different way.  Is there a way to 
view a list of old hostnames that are not listed in the hosts.cfg file 
but the server still has old logs stored?

Kris Springer
quoted from Galen Johnson


On 1/22/19 11:05 AM, Galen Johnson wrote:
probably need to use a quick command line 'for' loop.  Something like:

for Host in Cam{1..12}; do
./xymon 127.0.0.1 "drop $Host"
done

You also want to remove the other history info as well but I'd have to 
go find that.

=G=

On Tue, Jan 22, 2019 at 12:57 PM Kris Springer 
<user-c2caa0a7a8d5@xymon.invalid <mailto:user-c2caa0a7a8d5@xymon.invalid>> wrote:

    Is there a way to drop all host data for multiple hosts using a
    wildcard?  I know how to drop a single host and erase it's data,
    but I
    have a long list of IP Cameras that I changed in my hosts file and
    instead of dropping each individual hostname I'd like to drop all
    hosts
    that start with 'Cam'.  I attempted this but it didn't remove
    anything.

    ./xymon 127.0.0.1 "drop Cam*"

    -- 

    Kris Springer

list Paul Root · Tue, 22 Jan 2019 18:38:40 +0000 ·
Go to your hostdata directory. It will have a directory for each machine. You can rm -rf Cam* there.
Could be more in hist and rrd
quoted from Kris Springer


From: Xymon <xymon-bounces at xymon.com> On Behalf Of Kris Springer
Sent: Tuesday, January 22, 2019 12:18 PM
Cc: Xymon MailingList <xymon at xymon.com>
Subject: Re: [Xymon] drop multiple hosts with wildcard

Ok, let me ask the question a little different way.  Is there a way to view a list of old hostnames that are not listed in the hosts.cfg file but the server still has old logs stored?


Kris Springer


On 1/22/19 11:05 AM, Galen Johnson wrote:
probably need to use a quick command line 'for' loop.  Something like:

for Host in Cam{1..12}; do
./xymon 127.0.0.1 "drop $Host"
done

You also want to remove the other history info as well but I'd have to go find that.

=G=

On Tue, Jan 22, 2019 at 12:57 PM Kris Springer <user-c2caa0a7a8d5@xymon.invalid<mailto:user-c2caa0a7a8d5@xymon.invalid>> wrote:
Is there a way to drop all host data for multiple hosts using a
wildcard?  I know how to drop a single host and erase it's data, but I
have a long list of IP Cameras that I changed in my hosts file and
instead of dropping each individual hostname I'd like to drop all hosts
that start with 'Cam'.  I attempted this but it didn't remove anything.

./xymon 127.0.0.1 "drop Cam*"

--

Kris Springer


This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
list Kris Springer · Tue, 22 Jan 2019 11:40:56 -0700 ·
Yes, that's how I remove data from time to time, but I was hoping there would be a report that displays via the webpage, similar to the ghostlist.sh

Kris Springer
quoted from Paul Root


On 1/22/19 11:38 AM, Root, Paul T wrote:
Go to your hostdata directory. It will have a directory for each machine. You can rm -rf Cam* there.

Could be more in hist and rrd

*From:*Xymon <xymon-bounces at xymon.com> *On Behalf Of *Kris Springer
quoted from Paul Root
*Sent:* Tuesday, January 22, 2019 12:18 PM
*Cc:* Xymon MailingList <xymon at xymon.com>
*Subject:* Re: [Xymon] drop multiple hosts with wildcard

Ok, let me ask the question a little different way.  Is there a way to view a list of old hostnames that are not listed in the hosts.cfg file but the server still has old logs stored?


Kris Springer

On 1/22/19 11:05 AM, Galen Johnson wrote:

    probably need to use a quick command line 'for' loop.  Something
    like:

    for Host in Cam{1..12}; do

    ./xymon 127.0.0.1 "drop $Host"

    done

    You also want to remove the other history info as well but I'd
    have to go find that.

    =G=

    On Tue, Jan 22, 2019 at 12:57 PM Kris Springer
    <user-c2caa0a7a8d5@xymon.invalid <mailto:user-c2caa0a7a8d5@xymon.invalid>>
    wrote:

        Is there a way to drop all host data for multiple hosts using a
        wildcard?  I know how to drop a single host and erase it's
        data, but I
        have a long list of IP Cameras that I changed in my hosts file
        and
        instead of dropping each individual hostname I'd like to drop
        all hosts
        that start with 'Cam'.  I attempted this but it didn't remove
        anything.

        ./xymon 127.0.0.1 "drop Cam*"

        -- 
        Kris Springer


This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.