Skip to content
Permalink
c6bec06727
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
48 lines (37 sloc) 4.16 KB

Advanced grep in your alerts and dashboards.

wavectl allows users to execute regular expression searches on alerts and dashboards. Using the resource options, the user can specify fields and a regular expression to match for each field. wavectl will process only resources that satisfy all specified regular expressions. For show command, only the matched alerts/dashboards will be displayed, for push only the matching ones will be written to Wavefront, and so on.

For example: show alerts that have "Kubernetes" and "Utilization" in their names:

  $ wavectl show alert --name "Kubernetes.*Utilization"
  ID               NAME                                                                                     STATUS                              SEVERITY    
  1523082347619    Kubernetes - Node Network Utilization - HIGH (Prod)                                      CHECKING                            WARN      
  1523082347824    Kubernetes - Node Cpu Utilization - HIGH (Prod)                                          CHECKING                            WARN      
  1523082348005    Kubernetes - Node Memory Swap Utilization - HIGH (Prod)                                  SNOOZED                             WARN

The --match parameter can be used to search anywhere in the json representation of an alert or a dashboard rather than in known key value pairs.

For example: Show the dashboards that use metrics from the live environment

  $ wavectl show dashboard --match "env=live"
  ID                      NAME                                                        DESCRIPTION                                                                                         
  metadata-php            Metadata PHP                                                Monitors for Metadata in the PHP webapp                                                             
  octoproxy               Skynet Octoproxy                                            One look summary about the load balancer                                                            
  skynet-kube-box-pki     SKYNET KUBE BOX PKISomeNameToBeMachedInKubeBoxPki           Info about PKI system.

Write alerts back to Wavefront that have a specific person in the updaterId

  $ wavectl push /tmp/AdvancedGrep/dashboards dashboard --updaterId hbaba
  Replaced dashboard(s):
  ID                      NAME                                                        DESCRIPTION                                                                                         
  SKYNET-OCTOPROXY-DEV    Skynet Octoproxy Dev                                        One look summary about the load balancer                                                            
  data-retention          Data Retention                                              Info about Data                                                                                     
  jgranger001             Skynet Monitoring (Cloned)SomeMatchStringSomeMatchString                                                                                                        
  metadata-operations     Metadata Operations                                         Metrics about each operation that can be performed against the data store                           
  metadata-perfpod        Metadata PerfPod                                            Monitors for testing Metadata in the PerfPods                                                       
  metadata-php            Metadata PHP                                                Monitors for Metadata in the PHP webapp                                                             
  ...

wavectl uses python standard library's regular expression module. Any valid python regular expression can be specified for the resource options.