- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Server Management - Systems Insight Manager
- >
- Clean up old servers in SIM
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2010 03:48 AM
тАО08-23-2010 03:48 AM
Clean up old servers in SIM
Thanx,
Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2010 07:00 PM
тАО08-24-2010 07:00 PM
Re: Clean up old servers in SIM
Thanx,
Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2010 01:19 AM
тАО08-25-2010 01:19 AM
Re: Clean up old servers in SIM
Nice Job indeed but I have a few questions :
1/The query you described is an event query : this means that the result is a list of event, therefore if you select those for deletion, you will delete the events not the systems that generated them ? correct ?
I think you made it closely but what is missing is a combination of a system and an event query that HP SIM can do !
So from the UI, one can create a new collection by using the customize button in the collection panel. Then click on new for a new collection and select Choose members from the existing system and event collections. Now Use the all system collection for the system and the newly created event collection Unreachable for the last 90 days. The result should show you a system list that could use later for a delete task.
2/Delete Task:
now the funny part : using simple CLI.
A\ custom command tools creation and scheduling :
on the cms, create a batch to list systems to be deleted and to delete them when done :
autodelete.bat:
echo off
cd C:\HP-SIM-custom\Autodeletion-of-old-systems
REM delete old files
del C:\HP-SIM-custom\Autodeletion-of-old-systems\nodes.txt
REM Create list of systems to be deleted and delete each of them sequentially
mxquery -e "Fred Test" |find "DeviceName" >nodes.txt
for /f "tokens=2" %%f in (nodes.txt) do @mxnode -r %%f -x force
Fred Test is the collection you created in the step 1
adapt path for your environment...
B\Create now a custom tool that will launch this script and schedule through HP SIM periodically.
I need now to do some more testing with a proper collection that includes systems and events.
I 'll tell you tomorrow about it.
regards
Fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2010 06:41 AM
тАО08-25-2010 06:41 AM
Re: Clean up old servers in SIM
Thanx,
Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2010 10:58 AM
тАО08-25-2010 10:58 AM
Re: Clean up old servers in SIM
Is there some other identifier like a failed hardware status poll or something that would ensure that this entity has not been around for longer than a certain amount of time? Ideally it would be good to know that the thing I am deleting has been off the map fully for a while. Please let me know your thoughts.
Thanx,
Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2010 11:56 AM
тАО08-25-2010 11:56 AM
Re: Clean up old servers in SIM
The system not reachable event is by default automatically cleared by the system reachable event. Those events are generated by the internal system polling code as far as I know. Clear is not Delete !!!
The only concern I have at the moment is that if you have a bug with a new release/update and your task will be executed you could lose some history information.
Do you have special devices which are not originally supported by HP SIM (customer extensions) or special plug-ins which could
influence the HP SIM basic behavior?
As a background information:
- Thanks for triggering the discussion
- I got some inspiration from a scheduled task "Delete Events older than 90 days" which is not enabled by default.
- We have an IP range with important server but also some DHCP devices in the same range which leads to a similar problem if you want to use auto discovery but shorter unreachable time.
- I hoped this will motivate other to join the discussion (thanks to Fred). It seems to work)
- A good simple solutions needs some thinking time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2010 12:02 PM
тАО08-25-2010 12:02 PM
Re: Clean up old servers in SIM
I guess I was unaware that a System Reachable event actually clears the preceeding Unreachable event. That does help. We do not have any super custom entities in SIM that will not be rediscovered anyway and losing some history on the item is not the worst thing that could happen in the world.
So it is totally a workable solution and I thank you and Fred for the valuable input and help!
Thanx,
Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-26-2010 11:42 AM
тАО08-26-2010 11:42 AM
Re: Clean up old servers in SIM
Did you get a chance to test this out? The problem I am having is with the mxquery -e command in the batch file. It does not see the collection that I created that includes All Systems and the custom Event query. It sees everything else including the custom Event query when I just type mxquery alone. Please let me know if I am doing something wrong.
Thanx,
Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2010 06:32 AM
тАО10-25-2010 06:32 AM
Re: Clean up old servers in SIM
sorry it took so long to answer.
I actually faced the same issue as you did but didn't have time till now to look at it again...
Finally found a solution though :-)
Situation is the following :
1/either you stick to the first event query and you get a list of all devices that have been unreachable for X days then you delete them all...Some admins might use it...
2/you try to work more intelligently...I do sometimes, at least I try :-)
My first solution was a good idea but I mixed collection and queries..that is why it cannot work..
My workaround is the following :(still using some scriptings and the windows based grep command (available here : http://gnuwin32.sourceforge.net/packages/grep.htm)
4 steps:
1/gather the list of systems that are unreachable
2/gather the list of systems to compare against
3/generate the final list of systems to be deleted.
4/delete these systems
in this example I work with servers therefore my second query is using the "All Servers" collection to find the servers to be deleted.
1st script :
echo on
Rem Move to the script directory
cd C:\test-fred\script\
REM delete old files
del C:\test-fred\script\nodes*.txt
REM Create list of systems
mxquery -e "Not Reachable for the last x days" |find "DeviceName" >nodes1.txt
mxquery -e "All Servers" |find "DeviceName" >nodes2.txt
REM Parse them to extract the proper list of system to delete
"c:\Program Files (x86)\GnuWin32\bin\grep.exe" -f nodes2.txt nodes1.txt >nodestodelete.txt
REM Transform lines in columns
for /f "delims=" %%a in ('type "nodestodelete.txt"') do call :commande "%%a"
goto :eof
:commande
set ligne=%1
set ligne=%ligne:"=%
@echo %ligne% >>nodestodelete2.txt
2nd script:
echo off
REM Delete now devices
for /F "tokens=2" %%f in (nodestodelete2.txt) do @mxnode -r %%f -x force
I create a final script to call these two one after the other.This script will then be used in a custom command in HP SIM that will be scheduled as explained higher in this thread.
I am not that good at scripting, that is why I came up with this solution. I am pretty sure sone others can improve it, please do.
So better late than never...
hope it helps !
fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2010 06:55 AM
тАО10-25-2010 06:55 AM
Re: Clean up old servers in SIM
Thanx,
Matt