Product and Software: This article applies to all MMS platforms and MMS 2.5.0 and later.
The fault entries reside in multiple tables, so it is not easy to delete a subset of the fault list.
Here is a shell script that will wipe out the fault list in MMS. This script will also delete the fault history. However, the command to delete it could be removed.
delete_all_faults.sh
#!/bin/bash
function is_mmsrunning()
{
pgrep solid &> /dev/null
if [ $? -eq 0 ]; then
echo 1;
return;
fi
echo 0;
}
if [ $(is_mmsrunning) -eq 1 ];
then
echo 'Stopping Server'
/etc/init.d/mmgr stop
fi
echo 'Starting Solid'
/opt/aruba/solid/solid.sh start
sleep 5
echo 'Clearing fault tables'
/opt/aruba/solid/solsql -at -e "admin command 'hsb switch primary'" dba dba
sleep 5
/opt/aruba/solid/solsql -at -e "delete from aruba.nms.fault_correlation" dba dba
/opt/aruba/solid/solsql -at -e "delete from aruba.nms.fault" dba dba
/opt/aruba/solid/solsql -at -e "delete from aruba.nms.fault_history" dba dba
/opt/aruba/solid/solsql -at -e "delete from aruba.nms.fault_entity_to_MD" dba dba
echo 'Stopping Solid'
/opt/aruba/solid/solid.sh stop
echo 'Starting Server'
/etc/init.d/mmgr start
To use the script, follow these steps:
1) Access the MMS system using ssh as root.
2) Transfer the script or create it manually using an editor like vi or nano.
3) Change the script permission to make it executable:
chmod +x delete_all_faults.sh
4) Launch the script:
./delete_all_faults.sh