Skip to content

Commit

Permalink
sort
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <[email protected]>
  • Loading branch information
ArnobKumarSaha committed Jan 31, 2024
1 parent d523ee8 commit 88a920c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
35 changes: 16 additions & 19 deletions pkg/cmds/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,15 @@ var monitorLong = templates.LongDesc(`
var monitorExample = templates.Examples(`
# Check triggered alerts for a specific database
kubectl dba monitor get-alerts [DATABASE] [DATABASE_NAME] -n [NAMESPACE] \
--prom-svc=[PROM_SVC_NAME] --prom-svc-namespace=[PROM_SVC_NS] --prom-svc-port=[PROM_SVC_PORT]
kubectl dba monitor get-alerts [DATABASE] [DATABASE_NAME] -n [NAMESPACE]
# Check availability of grafana dashboard of a database
kubectl dba monitor dashboard [DATABASE] [DASHBOARD_NAME] \
--prom-svc=[PROM_SVC_NAME] --prom-svc-namespace=[PROM_SVC_NS] --prom-svc-port=[PROM_SVC_PORT]
kubectl dba monitor dashboard [DATABASE] [DASHBOARD_NAME]
# Check connection status of target with prometheus server for a specific database
kubectl dba monitor check-connection [DATABASE] [DATABASE_NAME] -n [NAMESPACE] \
--prom-svc=[PROM_SVC_NAME] --prom-svc-namespace=[PROM_SVC_NS] --prom-svc-port=[PROM_SVC_PORT]
kubectl dba monitor check-connection [DATABASE] [DATABASE_NAME] -n [NAMESPACE]
# Flags
# Common Flags
--prom-svc-name : name of the prometheus service
--prom-svc-namespace : namespace of the prometheus service
--prom-svc-port : port of the prometheus service
Expand Down Expand Up @@ -93,14 +90,14 @@ var alertExample = templates.Examples(`
Valid resource types include:
* elasticsearch
* mongodb
* kafka
* mariadb
* mongodb
* mysql
* postgres
* redis
* kafka
* perconaxtradb
* postgres
* proxysql
* redis
`)

func AlertCMD(f cmdutil.Factory) *cobra.Command {
Expand Down Expand Up @@ -133,14 +130,14 @@ var dashboardExample = templates.Examples(`
Valid dashboards include:
* elasticsearch
* mongodb
* kafka
* mariadb
* mongodb
* mysql
* postgres
* redis
* kafka
* perconaxtradb
* postgres
* proxysql
* redis
`)

func DashboardCMD(f cmdutil.Factory) *cobra.Command {
Expand Down Expand Up @@ -176,14 +173,14 @@ var connectionExample = templates.Examples(`
Valid resource types include:
* elasticsearch
* mongodb
* kafka
* mariadb
* mongodb
* mysql
* postgres
* redis
* kafka
* perconaxtradb
* postgres
* proxysql
* redis
`)

func ConnectionCMD(f cmdutil.Factory) *cobra.Command {
Expand Down
16 changes: 8 additions & 8 deletions pkg/monitor/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ func ConvertedResource(resource string) string {
switch res {
case api.ResourceCodeElasticsearch, api.ResourcePluralElasticsearch, api.ResourceSingularElasticsearch:
res = api.ResourcePluralElasticsearch
case api.ResourceCodeKafka, api.ResourcePluralKafka, api.ResourceSingularKafka:
res = api.ResourcePluralKafka
case api.ResourceCodeMariaDB, api.ResourcePluralMariaDB, api.ResourceSingularMariaDB:
res = api.ResourcePluralMariaDB
case api.ResourceCodeMongoDB, api.ResourcePluralMongoDB, api.ResourceSingularMongoDB:
res = api.ResourcePluralMongoDB
case api.ResourceCodePostgres, api.ResourcePluralPostgres, api.ResourceSingularPostgres:
res = api.ResourcePluralPostgres
case api.ResourceCodeMySQL, api.ResourcePluralMySQL, api.ResourceSingularMySQL:
res = api.ResourcePluralMySQL
case api.ResourceCodeKafka, api.ResourcePluralKafka, api.ResourceSingularKafka:
res = api.ResourcePluralKafka
case api.ResourceCodeProxySQL, api.ResourcePluralProxySQL, api.ResourceSingularProxySQL:
res = api.ResourcePluralProxySQL
case api.ResourceCodePerconaXtraDB, api.ResourcePluralPerconaXtraDB, api.ResourceSingularPerconaXtraDB:
res = api.ResourcePluralPerconaXtraDB
case api.ResourceCodePostgres, api.ResourcePluralPostgres, api.ResourceSingularPostgres:
res = api.ResourcePluralPostgres
case api.ResourceCodeProxySQL, api.ResourcePluralProxySQL, api.ResourceSingularProxySQL:
res = api.ResourcePluralProxySQL
case api.ResourceCodeRedis, api.ResourcePluralRedis, api.ResourceSingularRedis:
res = api.ResourcePluralRedis
case api.ResourceCodeMariaDB, api.ResourcePluralMariaDB, api.ResourceSingularMariaDB:
res = api.ResourcePluralMariaDB
default:
log.Fatalf("%s is not a valid resource type \n", resource)
}
Expand Down

0 comments on commit 88a920c

Please sign in to comment.