chef recipe to check the count of processes and monitor the number of open file descriptors

199 views Asked by At

I am trying to update the metricbeat_cookbook to get some required info.

  1. Monitor the number of Number of sessions and html5 client processes running each server. ps -ef | grep -i html5 | wc -l. This is the logic I need in the cookbook/recipe.

    execute 'ps -ef' do
      command 'ps -ef | grep -i html5 | wc -l'
      action :run
    end
    
  2. Open file descriptors on linux server (this is the logic cat /proc/sys/fs/file-nr)

    execute 'cat' do
      command 'cat /proc/sys/fs/file-nr'
      action :run
    end
    

Any response/help is highly helpful to me and - Thanks in Advance.

0

There are 0 answers