Discussion:
[Spacewalk-list] Way to remove stale system entries?
J***@Dell.com
2011-07-22 18:02:31 UTC
Permalink
Is there a script (supported or otherwise) to remove stale system entries from a spacewalk/RHN server?

Say I have a testing environment with limited RHEL entitlements, and people are constantly registering servers, do what they need to do, and then re-image the server or shut it down and move on to something else without manually removing the system entry from RHN before moving on. These stale entries not only populate the database needlessly, but also take up an entitlement.

Would be great if I could run a nightly cron job where server entries that have not checked in for X days are removed automatically...
Joshua Roys
2011-07-22 18:37:22 UTC
Permalink
Is there a script (supported or otherwise) to remove stale system
entries from a spacewalk/RHN server?
Say I have a testing environment with limited RHEL entitlements, and
people are constantly registering servers, do what they need to do, and
then re-image the server or shut it down and move on to something else
without manually removing the system entry from RHN before moving on.
These stale entries not only populate the database needlessly, but also
take up an entitlement.
Would be great if I could run a nightly cron job where server entries
that have not checked in for X days are removed automatically...
Hello,

It looks like there's a (old) script at:
http://git.fedorahosted.org/git/?p=spacewalk.git;a=blob;f=scripts/ncsu-rhntools/oldSystems.py;h=11a1597d70e491ff00cb1ca5cc148b05e9a8c5ab;hb=HEAD

Thanks,

Josh
David Glaser
2011-07-22 18:40:58 UTC
Permalink
I've attached the script that one of our temps wrote to remove systems
that have not checked in over a year (but it is configurable) and warn
if systems have been offline for over a given period of time. Maybe it
is what you are looking for.

We just run it out of cron with a number of command line switches.

Dave
Post by J***@Dell.com
Is there a script (supported or otherwise) to remove stale system
entries from a spacewalk/RHN server?
Say I have a testing environment with limited RHEL entitlements, and
people are constantly registering servers, do what they need to do,
and then re-image the server or shut it down and move on to something
else without manually removing the system entry from RHN before moving
on. These stale entries not only populate the database needlessly, but
also take up an entitlement.
Would be great if I could run a nightly cron job where server entries
that have not checked in for X days are removed automatically...
Miroslav Suchý
2011-07-22 21:47:15 UTC
Permalink
Is there a script (supported or otherwise) to remove stale system
entries from a spacewalk/RHN server?
Say I have a testing environment with limited RHEL entitlements, and
people are constantly registering servers, do what they need to do, and
then re-image the server or shut it down and move on to something else
without manually removing the system entry from RHN before moving on.
These stale entries not only populate the database needlessly, but also
take up an entitlement.
Would be great if I could run a nightly cron job where server entries
that have not checked in for X days are removed automatically...
_______________________________________________
Spacewalk-list mailing list
https://www.redhat.com/mailman/listinfo/spacewalk-list
# yum install spacewalk-utils
# delete-old-systems-interactive
Usage: delete-old-systems-interactive --idle=<idletime[w|d|h|m]>
[--host=<host>] [--username=<username>] [--password=<password>] [--force]
--
Miroslav Suchý
Red Hat Satellite Engineering
Glaser, David
2011-07-25 12:30:13 UTC
Permalink
Miroslav,

I saw the delete-systems utility, but it didn't give us all the functionality we wanted (a report by the system group that the machines exist in, multiple idle times in one run of the script, control over the line format). Perhaps a feature request to bugzilla would be in order?

Thanks,
Dave


-----Original Message-----
From: spacewalk-list-***@redhat.com [mailto:spacewalk-list-***@redhat.com] On Behalf Of Miroslav Suchý
Sent: Friday, July 22, 2011 5:47 PM
To: spacewalk-***@redhat.com
Subject: Re: [Spacewalk-list] Way to remove stale system entries?
Is there a script (supported or otherwise) to remove stale system
entries from a spacewalk/RHN server?
Say I have a testing environment with limited RHEL entitlements, and
people are constantly registering servers, do what they need to do,
and then re-image the server or shut it down and move on to something
else without manually removing the system entry from RHN before moving on.
These stale entries not only populate the database needlessly, but
also take up an entitlement.
Would be great if I could run a nightly cron job where server entries
that have not checked in for X days are removed automatically...
_______________________________________________
Spacewalk-list mailing list
https://www.redhat.com/mailman/listinfo/spacewalk-list
# yum install spacewalk-utils
# delete-old-systems-interactive
Usage: delete-old-systems-interactive --idle=<idletime[w|d|h|m]> [--host=<host>] [--username=<username>] [--password=<password>] [--force]

--
Miroslav Suchý
Red Hat Satellite Engineering
Jan Pazdziora
2011-07-25 15:10:27 UTC
Permalink
Post by Glaser, David
Miroslav,
I saw the delete-systems utility, but it didn't give us all the functionality we wanted (a report by the system group that the machines exist in, multiple idle times in one run of the script, control over the line format). Perhaps a feature request to bugzilla would be in order?
Actually, a patch would be preferred.
--
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat
Glaser, David
2011-07-25 15:29:56 UTC
Permalink
Ok, I'll see what I can do.

Thanks,
Dave


-----Original Message-----
From: spacewalk-list-***@redhat.com [mailto:spacewalk-list-***@redhat.com] On Behalf Of Jan Pazdziora
Sent: Monday, July 25, 2011 11:10 AM
To: spacewalk-***@redhat.com
Subject: Re: [Spacewalk-list] Way to remove stale system entries?
Post by Glaser, David
Miroslav,
I saw the delete-systems utility, but it didn't give us all the functionality we wanted (a report by the system group that the machines exist in, multiple idle times in one run of the script, control over the line format). Perhaps a feature request to bugzilla would be in order?
Actually, a patch would be preferred.
--
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat
Miroslav Suchy
2011-07-27 19:44:44 UTC
Permalink
Post by Jan Pazdziora
Post by Glaser, David
Miroslav,
I saw the delete-systems utility, but it didn't give us all the functionality we wanted (a report by the system group that the machines exist in, multiple idle times in one run of the script, control over the line format). Perhaps a feature request to bugzilla would be in order?
Actually, a patch would be preferred.
Well David already sent that
remove-old-profiles.py
which looks actually good. I have to find time to review it properly. It
may need some polishing (like replace that umich.edu with localhost, get
rid of that unnecessary prints) but we can either replace that perl
script or even have both available to users.

Mirek

Continue reading on narkive:
Loading...