What does Catalyst Free Database Space Checking rule do?
The rule checks for Freespace left in the Foglight backend database.
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.
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: The above script can be used from the Script Console dashboard to run the 'exec sp_spaceused" SQL if not possible to access the SQL Server directly.
Use the script below to manually trigger the metrics update and retrieve the latest metric value:
new com.quest.nitro.service.util.MBeanRef(javax.management.ObjectName.getInstance("com.quest.nitro.monitor:type=DatabaseSpace")).ref().execute(System.currentTimeMillis()) sleep(3000) #!CatalystTablespace#.topologyObjects.collect{ obj -> def val = server.DataService.retrieveLatestValue( obj, 'freeSize') "$val.startTime - $val.endTime : ${val.value.avg/1024.0/1024.0} MB, count ${val.value.count}" }.join('\n')
© ALL RIGHTS RESERVED. Termini di utilizzo Privacy Cookie Preference Center