Status code 127 for checking memory usage

hello guys,

i had written shell script for memory usage. and i am running the script with memory checks. provided full path . but while running the checksits frequently getting status code 127 and sometime its passing. i am not getting exactly the issue

please find the above snap its working fine 30 secsonds after that its giving status code 127…
thanks in adavance

Hey there,

It’s hard to say what the issue with the script is. Exit code 127 typically indicates that the script can’t be found, so I’m a bit confused because the check output doesn’t jive with the exit code. It would help to see the check definition and the script as the screenshots don’t really help in diagnosing the issue.

As an aside, is there a reason that you’re using a custom memory check instead of using some of the existing plugins that do just this?

Hey there,

Thanks for reaching out. issue with existing plugin is i am getting memory usage output in bytes format i wanted in human readable format (i,e GB, MG). i am using sensu/check-memory-usage plugin . in this plugin i am not able to insert flags and commands also… kindly help

and check config for plugin script is ;;

type: CheckConfig
api_version: core/v2
  name: check_memory_usage
  namespace: default
  created_by: admin
  check_hooks: null
  command: check-memory-usage -w 75 -c 90
  env_vars: null
    - alert_handler
  high_flap_threshold: 0
  interval: 30
  low_flap_threshold: 0
  output_metric_format: ''
  output_metric_handlers: null
  pipelines: []
  proxy_entity_name: ''
  publish: true
  round_robin: true
    - memory-check-asset
    - sensu-ruby-runtime
  secrets: null
  stdin: false
  subdue: null
    - system
  timeout: 0
  ttl: 0
  max_output_size: 0
  discard_output: false

this config is giving me the output in bytes format . is there any way to convert to human readbale format… thanking in advance

let me explain the scenario, i had installed sensu to monitor the 2 azure vms and i have 3 checks on every vm . for 2 checks i had used the built in plugin in sensu bonsai . and for 3rd check i,e for memory usage i used sensu plugin but the output was in the bytes format. i was not able to convert to human readble format. so i thought of writing own script and executing so same thing i wrote in shell scripted and kept in /tmp/ folder in every containers. but all containers script is running properly. only in particular vm i am getting error like this… NOTE : i am running sensu backend and agents as docker containers.