linux_wiki:xymon_cpu_load_threshold_calc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:xymon_cpu_load_threshold_calc [2016/11/27 00:10]
billdozor [Server side]
linux_wiki:xymon_cpu_load_threshold_calc [2019/05/25 23:50] (current)
Line 57: Line 57:
 # Description: Calculate a xymon client's cpu load (Run on Xymon Server periodically with cron) # Description: Calculate a xymon client's cpu load (Run on Xymon Server periodically with cron)
 # Dependency: Requires 'bc' package # Dependency: Requires 'bc' package
 +# Last Change: 2018-05-22
 +# Recent Changes:-Updated awk search to look for [nproc] at the beginning of the line
  
 #======================= #=======================
Line 133: Line 135:
   node_name=${1}   node_name=${1}
  
-  # Lie to Xymon that the node's cpu is yellow, forcing a hostdata snapshot+  # Lie to Xymon that the node's cpu is green, then yellow, forcing a hostdata snapshot 
 +  xymon 127.0.0.1 "status ${node_name}.cpu green $(date)"
   xymon 127.0.0.1 "status ${node_name}.cpu yellow $(date)"   xymon 127.0.0.1 "status ${node_name}.cpu yellow $(date)"
 } }
Line 190: Line 193:
  
   # Get the number of procs reported from node's most recent host data file   # Get the number of procs reported from node's most recent host data file
-  node_num_procs="$(cat ${xymon_hostdata_dir}/${node}/$(ls -tr ${xymon_hostdata_dir}/${node}/ | tail -1) | awk '/nproc/ { getline; print }')"+  node_num_procs="$(cat ${xymon_hostdata_dir}/${node}/$(ls -tr ${xymon_hostdata_dir}/${node}/ | tail -1) | awk '/^\[nproc]/ { getline; print }')"
      
   # If node_num_procs is empty or not a number, move to the next node   # If node_num_procs is empty or not a number, move to the next node
  • linux_wiki/xymon_cpu_load_threshold_calc.1480223420.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)