-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release v1.15.1 - fix netprobe installs and add minor features
- Loading branch information
1 parent
55cce77
commit ee9ec39
Showing
80 changed files
with
690 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1.15.0 | ||
v1.15.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# `gdna explain` | ||
|
||
The `gdna explain` command is for users writing new reports and want to see how the report query will be evaluated by the SQLite query analyser. The command only works for "basic" reports, i.e. those in the output of `gdna list` with and empty value in the TYPE column. | ||
|
||
The output shows the underlying SQL query, with all embedded parameters resolved and then a tree style `EXPLAIN` query output. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
# `gdna start` | ||
|
||
Use `gdna start` to start a background process that acquires, process and reports data as well as being able to optionally send email reports on a schedule. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Stop the running background `gdna` process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/* | ||
Copyright © 2024 ITRS Group | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package cmd | ||
|
||
import ( | ||
_ "embed" | ||
"errors" | ||
"os" | ||
"syscall" | ||
"time" | ||
|
||
"github.com/itrs-group/cordial/pkg/host" | ||
"github.com/itrs-group/cordial/pkg/process" | ||
"github.com/rs/zerolog/log" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
//go:embed _docs/stop.md | ||
var stopCmdDescription string | ||
|
||
//go:embed _docs/restart.md | ||
var restartCmdDescription string | ||
|
||
func init() { | ||
GDNACmd.AddCommand(stopCmd) | ||
GDNACmd.AddCommand(restartCmd) | ||
} | ||
|
||
var stopCmd = &cobra.Command{ | ||
Use: "stop", | ||
Short: "Stop background GDNA process", | ||
Long: stopCmdDescription, | ||
Args: cobra.ArbitraryArgs, | ||
CompletionOptions: cobra.CompletionOptions{ | ||
DisableDefaultCmd: true, | ||
}, | ||
SilenceUsage: true, | ||
DisableAutoGenTag: true, | ||
DisableSuggestions: true, | ||
DisableFlagsInUseLine: true, | ||
RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
return stop() | ||
}, | ||
} | ||
|
||
func stop() (err error) { | ||
pid, err := process.GetPID(host.Localhost, "gdna", nil, nil, "start") | ||
if err != nil { | ||
if err == os.ErrProcessDone { | ||
log.Info().Msg("process not found") | ||
return nil | ||
} | ||
log.Error().Err(err).Msg("failed to find process") | ||
return | ||
} | ||
|
||
log.Info().Msgf("would kill pid %d", pid) | ||
h := host.Localhost | ||
if err = h.Signal(pid, syscall.SIGTERM); err == os.ErrProcessDone { | ||
log.Info().Msgf("terminated PID %d", pid) | ||
return nil | ||
} | ||
|
||
if errors.Is(err, syscall.EPERM) { | ||
return os.ErrPermission | ||
} | ||
|
||
for j := 0; j < 10; j++ { | ||
time.Sleep(250 * time.Millisecond) | ||
if err = h.Signal(pid, syscall.SIGTERM); err == os.ErrProcessDone { | ||
log.Info().Msgf("terminated PID %d", pid) | ||
return nil | ||
} | ||
} | ||
|
||
if err = h.Signal(pid, syscall.SIGKILL); err == os.ErrProcessDone { | ||
log.Info().Msgf("killing PID %d", pid) | ||
return nil | ||
} | ||
|
||
return err | ||
} | ||
|
||
var restartCmd = &cobra.Command{ | ||
Use: "restart", | ||
Short: "Restart background GDNA process", | ||
Long: restartCmdDescription, | ||
Args: cobra.ArbitraryArgs, | ||
CompletionOptions: cobra.CompletionOptions{ | ||
DisableDefaultCmd: true, | ||
}, | ||
SilenceUsage: true, | ||
DisableAutoGenTag: true, | ||
DisableSuggestions: true, | ||
DisableFlagsInUseLine: true, | ||
RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
return nil | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package cmd | ||
|
||
// REST API to control limited features | ||
|
||
// `ignore` set | ||
|
||
// `grouping` set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.