The rule checks for Freespace left in the Foglight backend database.
1). The freeSize metric should be updated every hour. It is from the "unallocated space" of:
exec sp_spaceused
The "unallocated space" should change when the auto-growth event happens in the DB.
2). You can use the following script to list the freeSize metrics and its update time stamps, and compare with the number from SQL output shortly after the metric is just updated.
Navigate to Script Editor (Administration > Tooling > Script Console > Scripts tab):
Click the Add button. Paste in the following script in the Script box and click Run
import com.quest.nitro.service.util.JDBCHelper;
import groovy.sql.Sql;
import java.sql.*;
import org.apache.commons.io.IOUtils;
def sb=new StringBuilder()
def ds = JDBCHelper.getDataSource(null);
def query(ds, sql, output){
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
conn = JDBCHelper.getConnection(ds);
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
JDBCHelper.formatResultSet(output, rs);
}
finally {
JDBCHelper.cleanUp(conn, stmt, rs);
}
}
query(ds, 'exec sp_spaceused', sb)
return sb
Note:You can run the above script in Script Console dashboard to run the 'exec sp_spaceused" sql if you cannot access the SQL Server directly.