Ways to check if a repository (rps) file is corrupted
book
Article ID: 303891
calendar_today
Updated On:
Products
VMware Smart Assurance
Issue/Introduction
This article covers the steps to determine whether a Smarts repository file is corrupted or not
Environment
Smarts 10.1.X
Resolution
There can be several types of Smarts repository corruption. The following sections explain how to check and fix Smarts repository for some common types.
Treating the .rps file as a Windows text file. This results in the .rps file ending each line in it with \r\n (carriage return, line feed for the non-Unix types). Detecting this is easy on *NIX, head -2 <name>.rps | od -c
and look for the pattern \r \n, Example: head -2 mybad.rps | od -c 0000000 V 1 1 \r \n # \r \n 0000012
In the case of a .rps file with carriage return, line feed in it you can use either dos2unix on it or if you're on Windows and it does not have dynamic models then use:
<BASEDIR>\smarts\bin\sm_fixrps.exe sm_fixrps --help will tell you how to invoke it and where it puts files.
Repository .rps file was truncated There should be an equal number of lines starting with a capital C followed by a space, a capital T followed by a space and a capital R followed by a space.
On *NIX you can use egrep to find patterns and wc to count the number of instances, Example: egrep '^C ' mybad.rps | wc -l 4321 egrep '^T ' mybad.rps | wc -l 4321 egrep '^R ' mybad.rps | wc -l 4321
Repository .rps file has bad/invalid values This corruption occurs when .rps file itself is syntactically ok but has bad/invalid values stored in it, values which cause problems during or after the restore. There is no way to easily detect this type of corruption. The best way to proceed is to restore the .rps with --errlevel=debug, which will cause more output to the log file. This can then be provided to VMware by Broadcom support for further analysis.