All Collections
Custom Values Monitoring
Custom Values Monitoring

This article describes how to send custom values to CloudStats

Andrey avatar
Written by Andrey
Updated over a week ago

You can send custom values to CloudStats and receive alerts if they get triggered on your server.

For this you will need to have:

  1. Server ID  - you can get it from URL, for example:

  2. Server KEY - you can get it from the file "config.yml"
    cat /home/cloudstats_agent/config.yml

  3. KEY - the key that you want to send, anything like "connections"

  4. VALUE - the value that you want to send, like "100"

  5. STATE - either success or fail

A change of STATE from SUCCESS to FAIL will trigger an ALERT. Same for FAIL to SUCCESS.

You need to implement logic for this into your script.

Custom values API

  1. Create a new key, value, state custom value:

For authentication it needs the SERVER_ID and the KEY used by the agent.

SERVER_ID is set with the id parameter and the AGENT_KEY with key=AGENT_KEY

The api can create a batch of custom values(key, value and state)
Each custom value must contain the key, the value and the state.
The STATE can be success or fail.

JSONish representation of the params:
  id: SERVER_ID,
  agent_key: AGENT_KEY,
  values: [
      key: 'key',
      value: 'value',
      state: 'success'
    }, {
      key: 'key2',
      value: 'value',
      state: 'fail'

Example to create 1 new value:

curl -X POST -d 'id=SERVER_ID&agent_key=AGENT_KEY&values[][key]=KEY&values[][state]=STATE&values[][value]=VALUE'

  agent_key: AGENT_KEY,
  value='new value',
  state='new state'


curl -X PUT -d 'agent_key=AGENT_KEY&key=KEY&value=VALUE&state=STATE'

Did this answer your question?