Contacts     ->      ICQ:    699 512 265,         E-Mail: CerebroSQL@gmail.com

  • YouTube Social  Icon

Create a table for monitoring the server's file systems

# For monitoring pre-database configuration instructions available space on file systems for Linux | AIX similar systems
# Supported version of the database since 10.2.0.5

# Create a directory in the database

create directory cera_scr as '/u01/app/oracle/scripts/'
  
p.s.: to improve safety makes sense to create a separate user (without connection), for example mon_fs
create user mon_fs identified by <Password>

Created in the directory (/u01/app/oracle/scripts/) to create a script with any name, for example size_fs.sh

$vi size_fs.sh
>#!/bin/bash
/bin/df -Pl

# Add permission for execution
$chmod +x ./size_fs.sh

# Check the validity of the script by running it
# In the database to create a table with the following structure

create table <Table_owner>.<Table_name>
  (
   fsname   varchar2(100),
   blocks   number,
   used     number,
   avail    number,
   capacity varchar2(10),
   mount    varchar2(100)
  )
  organization external
  (
    type oracle_loader
    default directory <Directory name>
    access parameters
    (
      records delimited
      by newline
      preprocessor
      <Directory name>:'<Script name>'
      skip 1
      fields terminated by
      whitespace ldrtrim
    )
    location
    (
      <Directory name>:'<Script name>'
    )
  )
  
#Example!
# Directory: Cera_scr
# Script: size_fs.sh
# User: mon_fs
 
create table mon_fs.df_table
  (
   fsname   varchar2(100),
   blocks   number,
   used     number,
   avail    number,
   capacity varchar2(10),
   mount    varchar2(100)
  )
  organization external
  (
    type oracle_loader
    default directory cera_scr
    access parameters
    (
      records delimited
      by newline
      preprocessor
      cera_scr:'size_fs.sh'
      skip 1
      fields terminated by
      whitespace ldrtrim
    )
    location
    (
      cera_scr:'size_fs.sh'
    )
  )
 

Execute a query to create a table to ensure correct operation
select * from mon_fs.df_table

# Configure Cerebro
1. Program settings:
Settings-monitoring
In the "Table Name monitoring storage" to indicate full name of the table created earlier
In the "Warning level [30-99]" to specify a value above which will generate a message log of recorded
p.s .: name of the table, as well as the level of message generation in version 3.6 are the same for all databases and drives.


2. Monitoring settings for a specific database
Existence Go to the tab of the main window.
Press the "Config" button
Select in the tree from left to the right database, install a check MonFS.
Save changes.