Skip to content

Instantly share code, notes, and snippets.

@stefhen
Last active November 14, 2016 20:47
Show Gist options
  • Select an option

  • Save stefhen/4af8e3886a6724c99d3bbad493ca76e5 to your computer and use it in GitHub Desktop.

Select an option

Save stefhen/4af8e3886a6724c99d3bbad493ca76e5 to your computer and use it in GitHub Desktop.

Revisions

  1. Stefhen Hovland revised this gist Nov 14, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion monitoring-id.txt
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    # Extract hostname to place in collectd.conf
    rsc --rl10 cm15 index_instance_session /api/sessions/instance --x1 '.monitoring_id' ; echo
    rsc --rl10 cm15 index_instance_session /api/sessions/instance --x1 '.monitoring_id'
  2. Stefhen Hovland revised this gist Nov 14, 2016. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion monitoring-id.md → monitoring-id.txt
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    * Extract hostname to place in collectd.conf
    # Extract hostname to place in collectd.conf
    rsc --rl10 cm15 index_instance_session /api/sessions/instance --x1 '.monitoring_id' ; echo
    2 changes: 1 addition & 1 deletion rsc.md → rsc.txt
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    * Extract session id
    # Extract session id
    rsc --rl10 --x1 ':has(.rel:val("self")).href' cm15 index_instance_session /api/sessions/instance
  3. Stefhen Hovland revised this gist Nov 14, 2016. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion monitoring-id.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    ### Extract hostname to place in collectd.conf
    * Extract hostname to place in collectd.conf
    rsc --rl10 cm15 index_instance_session /api/sessions/instance --x1 '.monitoring_id' ; echo
    2 changes: 1 addition & 1 deletion rsc.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    ### Extract session id
    * Extract session id
    rsc --rl10 --x1 ':has(.rel:val("self")).href' cm15 index_instance_session /api/sessions/instance
  4. Stefhen Hovland revised this gist Nov 14, 2016. 2 changed files with 3 additions and 1 deletion.
    2 changes: 2 additions & 0 deletions monitoring-id.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    ### Extract hostname to place in collectd.conf
    rsc --rl10 cm15 index_instance_session /api/sessions/instance --x1 '.monitoring_id' ; echo
    2 changes: 1 addition & 1 deletion rsc.txt → rsc.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    # Extract session id
    ### Extract session id
    rsc --rl10 --x1 ':has(.rel:val("self")).href' cm15 index_instance_session /api/sessions/instance
  5. Stefhen Hovland revised this gist Nov 14, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions rsc.txt
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    # Extract session id
    rsc --rl10 --x1 ':has(.rel:val("self")).href' cm15 index_instance_session /api/sessions/instance
  6. Stefhen Hovland renamed this gist Nov 7, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. Stefhen Hovland renamed this gist Nov 7, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. Stefhen Hovland revised this gist Nov 7, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion steps.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    - Append additional collectd metric to `/etc/collectd.conf` TypesDb line
    - Append additional collectd metric to `/etc/collectd.conf` TypesDb line
    - Find instance self via `rsc.txt` command above
  9. Stefhen Hovland revised this gist Nov 7, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions steps.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    - Append additional collectd metric to `/etc/collectd.conf` TypesDb line
  10. Stefhen Hovland renamed this gist Nov 7, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  11. Stefhen Hovland renamed this gist Oct 18, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  12. Stefhen Hovland revised this gist Oct 18, 2016. 1 changed file with 9 additions and 7 deletions.
    16 changes: 9 additions & 7 deletions command.txt
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,11 @@
    SESSION=$(rsc --rl10 --x1 ':has(.rel:val("self")).href' cm15 index_instance_session /api/sessions/instance)

    rsc --rl10 cm15 create alert_specs \
    alert_spec[escalation_name]=warning \
    alert_spec[threshold]=5 alert_spec[condition]=">" \
    alert_spec[variable]="load" alert_spec[duration]=2 \
    alert_spec[name]="ccc" \
    alert_spec[file]="load/load.shortterm"
    alert_spec[subject_href]=$SESSION
    rsc --rl10 cm15 create alert_specs \
    alert_spec[escalation_name]=warning \
    alert_spec[threshold]=5 \
    alert_spec[condition]=">" \
    alert_spec[variable]="shortterm" \
    alert_spec[duration]=2 \
    alert_spec[name]="xxx" \
    alert_spec[file]="load/load" \
    alert_spec[subject_href]=$SESSION
  13. Stefhen Hovland revised this gist Oct 18, 2016. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion command.txt
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,9 @@
    SESSION=$(rsc --rl10 --x1 ':has(.rel:val("self")).href' cm15 index_instance_session /api/sessions/instance)

    rsc --rl10 cm15 create alert_specs alert_spec[escalation_name]=warning alert_spec[threshold]=5 alert_spec[condition]=">" alert_spec[variable]="load" alert_spec[duration]=2 alert_spec[name]="ccc" alert_spec[file]="load/load.shortterm" alert_spec[subject_href]=$SESSION
    rsc --rl10 cm15 create alert_specs \
    alert_spec[escalation_name]=warning \
    alert_spec[threshold]=5 alert_spec[condition]=">" \
    alert_spec[variable]="load" alert_spec[duration]=2 \
    alert_spec[name]="ccc" \
    alert_spec[file]="load/load.shortterm"
    alert_spec[subject_href]=$SESSION
  14. Stefhen Hovland revised this gist Oct 18, 2016. 1 changed file with 1 addition and 5 deletions.
    6 changes: 1 addition & 5 deletions command.txt
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,3 @@
    SESSION=$(rsc --rl10 --x1 ':has(.rel:val("self")).href' cm15 index_instance_session /api/sessions/instance)

    rsc --rl10 cm15 create alert_specs alert_spec[escalation_name]=warning \
    alert_spec[threshold]=5 alert_spec[condition]=">" \
    alert_spec[variable]=load alert_spec[duration]=2 \
    alert_spec[name]="stefhen test load spec" \
    alert_spec[file]=load/load alert_spec[subject_href]=$SESSION
    rsc --rl10 cm15 create alert_specs alert_spec[escalation_name]=warning alert_spec[threshold]=5 alert_spec[condition]=">" alert_spec[variable]="load" alert_spec[duration]=2 alert_spec[name]="ccc" alert_spec[file]="load/load.shortterm" alert_spec[subject_href]=$SESSION
  15. Stefhen Hovland revised this gist Oct 18, 2016. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions command.txt
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    # rsc --rl10 cm15 create alert_specs alert_spec[escalation_name]=warning \
    alert_spec[threshold]=5 alert_spec[condition]=">" \
    alert_spec[variable]=load alert_spec[duration]=2 \
    alert_spec[name]="stefhen test load spec" \
    alert_spec[file]=/etc/collectd.d/load.conf
    SESSION=$(rsc --rl10 --x1 ':has(.rel:val("self")).href' cm15 index_instance_session /api/sessions/instance)

    rsc --rl10 cm15 create alert_specs alert_spec[escalation_name]=warning \
    alert_spec[threshold]=5 alert_spec[condition]=">" \
    alert_spec[variable]=load alert_spec[duration]=2 \
    alert_spec[name]="stefhen test load spec" \
    alert_spec[file]=load/load alert_spec[subject_href]=$SESSION
  16. Stefhen Hovland renamed this gist Oct 18, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  17. Stefhen Hovland revised this gist Oct 18, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile2.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    rsc --rl10 --x1 ':has(.rel:val("self")).href' cm15 index_instance_session /api/sessions/instance
  18. Stefhen Hovland revised this gist Oct 18, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion command.txt
    Original file line number Diff line number Diff line change
    @@ -1 +1,5 @@
    # rsc --rl10 cm15 create alert_specs alert_spec[escalation_name]=warning alert_spec[threshold]=5 alert_spec[condition]=">" alert_spec[variable]=load alert_spec[duration]=2 alert_spec[name]="stefhen test load spec" alert_spec[file]=/etc/collectd.d/load.conf
    # rsc --rl10 cm15 create alert_specs alert_spec[escalation_name]=warning \
    alert_spec[threshold]=5 alert_spec[condition]=">" \
    alert_spec[variable]=load alert_spec[duration]=2 \
    alert_spec[name]="stefhen test load spec" \
    alert_spec[file]=/etc/collectd.d/load.conf
  19. Stefhen Hovland revised this gist Oct 18, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions command.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    # rsc --rl10 cm15 create alert_specs alert_spec[escalation_name]=warning alert_spec[threshold]=5 alert_spec[condition]=">" alert_spec[variable]=load alert_spec[duration]=2 alert_spec[name]="stefhen test load spec" alert_spec[file]=/etc/collectd.d/load.conf
  20. Stefhen Hovland created this gist Oct 18, 2016.
    39 changes: 39 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    usage: rsc [<FLAGS>] cm15 create alert_specs [<PARAMS>]

    Creates a new AlertSpec with the given parameters.
    Required parameters:
    alert_spec

    PARAMS:
    alert_spec[escalation_name]=string
    <optional> Escalate to the named alert escalation when the alert is triggered. Must either escalate or vote.

    alert_spec[subject_href]=string
    <optional> The href of the resource that this AlertSpec should be associated with. The subject can be a ServerTemplate, Server, ServerArray, or Instance.

    alert_spec[description]=string
    <optional> The description of the AlertSpec.

    alert_spec[threshold]=string
    <required> The threshold of the condition sentence.

    alert_spec[condition]=string
    <required, [>|>=|<|<=|==|!=]> The condition (operator) in the condition sentence.

    alert_spec[vote_type]=string
    <optional, [grow|shrink]> Vote to grow or shrink a ServerArray when the alert is triggered. Must either escalate or vote.

    alert_spec[variable]=string
    <required> The RRD variable of the condition sentence.

    alert_spec[duration]=string
    <required> The duration in minutes of the condition sentence.

    alert_spec[vote_tag]=string
    <optional> Should correspond to a vote tag on a ServerArray if vote to grow or shrink.

    alert_spec[name]=string
    <required> The name of the AlertSpec.

    alert_spec[file]=string
    <required> The RRD path/file_name of the condition sentence.