Jons Scripts

Script to Report all .wsp data for the last five minutes:

 

#!/bin/bash
find /opt/graphite/storage/whisper/ -name "*.wsp"|while read fname; do
  printf "Last five minutes of entries in $fname \n"
  /opt/quantum/python27/bin/whisper-fetch.py --pretty "$fname" | tail -n 5
  printf "\n"
done
 

Output:

 

Last five minutes of entries in /opt/graphite/storage/whisper/domain/default/cluster/default/host/spss-mac-mini:meta/client/kernel/fs/mac_snfs/sg/sg1/io/san/Wrt_Time_Dev/count.wsp
Sun May 22 17:25:00 2016        0.000000
Sun May 22 17:26:00 2016        0.000000
Sun May 22 17:27:00 2016        0.000000
Sun May 22 17:28:00 2016        0.000000
Sun May 22 17:29:00 2016        0.000000
 

 

 

#!/bin/bash
find /opt/graphite/storage/whisper/ -name "*.wsp"|while read fname; do
  printf "Collecting wsp info on file \n $fname \n\n"
  echo -e "Last five minutes of entries in $fname \n" >> wsp.out
  /opt/quantum/python27/bin/whisper-fetch.py --pretty "$fname" | tail -n 5 >> wsp.out
  echo -e "\n" >> wsp.out
done

 

 

 

Script to clean data base tables:

 

[root@cx-node2 bin]# cat cleandb.psql
TRUNCATE TABLE discover_file_system;
TRUNCATE TABLE discover_library;
TRUNCATE TABLE discover_host_2_file_system;
TRUNCATE TABLE discover_host CASCADE;
 

[root@cx-node2 bin]# su postgres
bash-4.1$ psql  connect_db  < cleandb.psql
TRUNCATE TABLE
TRUNCATE TABLE
TRUNCATE TABLE
NOTICE:  truncate cascades to table "nas_client"
NOTICE:  truncate cascades to table "nas_activity"
NOTICE:  truncate cascades to table "nas_activity_sequence"
TRUNCATE TABLE

 

Log Collect Script (incomplete)

 


 

If you run this as root on each node you’ll find logs in the Stornext GUI for each node prefixed by the hostname.

 

ip addr show > /var/www/html/connect/logs/ip_addr.out;host=$(hostname); tar -czvf /scratch/"$host"_snc_log_files.tar.gz /var/log/carbon* /var/log/messages* /var/www/html/connect/logs/* /opt/quantum/mintd/etc/* /opt/quantum/connector/etc/* /etc/hosts;mv /scratch/"$host"_snc_log_files.tar.gz /usr/adic/HAM/shared/capture_state/

 

Using mintd_control

 

/opt/quantum/mintd/mintd_control.py set --minthost=192.168.199.42

/opt/quantum/mintd/mintd_control.py query --getconfig

/opt/quantum/mintd/mintd_control.py set --hostname cx-node2-meta
 

 



This page was generated by the BrainKeeper Enterprise Wiki, © 2018