HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: //opt/perf/examples/adviser/proc_num_files
# Adviser Script:  proc_num_files
#
# This script looks for processes that have more than 10 files open
# (PROC_FILE_OPEN).  When found, it prints out the name of the process
# and the number of open files.
#
# Note: You must use a "proc_file loop" within the "process loop" in 
#       order access any of the PROC_FILE_* metrics associated with
#       the specified process.
#
# The glance adviser capability allows you to print metrics to stdout.
# You can redirect this output to a file, if desired.

headers_printed = headers_printed

if headers_printed == 0 then {
  print "Time      Proc Name    Proc_File_Open"
  headers_printed = 1
}

process loop {
  num_file_open = 0
  proc_file loop {
    if proc_file_open > 10 then {
      num_file_open = proc_file_open
    }
  }
  if num_file_open > 10 then {
    print gbl_stattime, "  ", proc_proc_name|12, "   ",
      num_file_open|6
  }
}