Skip to content

Commit

Permalink
release v1.15.1 - fix netprobe installs and add minor features
Browse files Browse the repository at this point in the history
  • Loading branch information
pgalbavy-itrs committed Jul 4, 2024
1 parent 55cce77 commit ee9ec39
Show file tree
Hide file tree
Showing 80 changed files with 690 additions and 364 deletions.
30 changes: 28 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
# Change Log

## Version v1.15.0
## Version v1.15.1

> [!NOTE]
> **Released 2024-06-26**
> **Released 2024-07-04**
>
> Please report issues via [github](https://github.com/ITRS-Group/cordial/issues) or the [ITRS Community Forum](https://community.itrsgroup.com/).
### v1.15.1 Fixes

* Fix handling of new Netprobe release archive names in 6.9.0

### v1.15.1 Changes

* `tools/geneos`

* add support for a `minimal` component type, which is a Netprobe without Collection Agent
* `geneos init demo` now supports the `--minimal`/`-M` flag to use the minimal Netprobe in the deployment
* the global configuration file (typically `${HOME}/.config/geneos/geneos.json`) now only saves chasnges to defaults. This allows defaults to be updated in the code without needing manual changes. Note that you may need to edit the file to clear out saved parameters that were the default but have the defaults have now changed.
* changes `geneos set x+="y"` behaviour such that a space is only prefixed to the new option if it starts with a dash (`-`). This allows paths and other parameters that are not space separated to work
* the `geneos init san` and `geneos init floating` commands have been deprecated in favour of `geneos deploy san` and `geneos deploy floating`, respectively
* add the start of a `geneos config export` command that archives instances either as a back-up or for re-import later, once the matching `geneos config import` command is added. This is work-in-progress.

* `gdna`

* Update to Geneos 6.9.0 and use the `minimal` Netprobe to reduce image size
* Add a `gdna stop` command, to stop background GDNA processes. An initially empty `gdna restart` command has been added for later completion.

* General

* Centos 7 has gone EOL so no test images can be built, remove them

---

### v1.15.0 Changes

> 🎁 Introducing GDNA 🎈
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ RUN --mount=type=secret,id=credentials.json,mode=0444,required,target=/home/gene
set -eux; \
mkdir gdna; \
geneos deploy gateway "Demo Gateway" --geneos /home/geneos --nosave --port 8100 --tls options="-demo" --include 100:/etc/geneos/gdna/gdna.include.xml; \
geneos deploy netprobe GDNA --nosave --port 8101; \
geneos deploy minimal GDNA --nosave --port 8101; \
geneos deploy webserver GDNA --nosave --port 8443 --import config/config.xml=/etc/geneos/gdna/web-config.xml;
ENTRYPOINT [ "/etc/geneos/gdna/start-up.sh" ]
CMD [ "bash" ]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> [!NOTE]
>
> This is **Version v1.15.0** - Released 2024-06-26 - See [`CHANGELOG.md`](CHANGELOG.md) for more details.
> This is **Version v1.15.1** - Released 2024-07-04 - See [`CHANGELOG.md`](CHANGELOG.md) for more details.
> 🎁 Introducing GDNA 🎈
>
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.15.0
v1.15.1
2 changes: 0 additions & 2 deletions gdna/cmd/_docs/email.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# `gdna email`

The `gdna email` command runs reports and sends the results to the configured email destinations.

You can limit the reports included using the `--report`/`-r` option, which accepts a single parameter which can be an individual report name of a glob-style wildcard that may match multiple reports. Remember to quote any special characters to avoid shell expansion. To see which reports are available use the `gdna list` command.
Expand Down
2 changes: 0 additions & 2 deletions gdna/cmd/_docs/explain.md
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.
2 changes: 0 additions & 2 deletions gdna/cmd/_docs/fetch.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# `gdna fetch`

The `gdna fetch` command collects a new set of license token data from the configured sources.

The fetch command will normally work through the configured license usage sources and load the transformed data into the SQLite database. If the program configuration has been set, usually during report development, to make temporary tables actually not temporary then these are not updated during fetching of data. This behaviour can be changed using the `--post-process`/`-p` flag, which executes the routines required to create and update these intermediate tables. Another flags, `--time`/`-T`, is also for diagnostics and development of reports and this sets the timestamp of data imported from files to the current time rather than the modification time of the file. Note that this flag only affects plain files sources from the `licd` TCP endpoint and not reporting summary files, which have a timestamp in the filename.
Expand Down
2 changes: 0 additions & 2 deletions gdna/cmd/_docs/gdna.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# `gdna`

The `gdna` program combines an Extract-Transform-Load (ETL) and reporting tool that collects Geneos license usage data to generate reports of license utilisation which are expressed as levels of monitoring coverage. The reports are fully configurable and are built using SQLite queries.

The data used is from either `licd` CSV reports, which are described [here](https://docs.itrsgroup.com/docs/geneos/current/administration/licence-daemon/index.html#csv-files) or, where file access to the `licd` working directory is available, License Summary reports generated by newer released of `licd`.
Expand Down
2 changes: 0 additions & 2 deletions gdna/cmd/_docs/list.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# `gdna list`

`gdna list` displays a list of configured reports along with information about the report title and any restrictions on running for certain types of outputs.

The output is formatted as a text table by default, for display on the console. You can also select alternative formats using the `--format`/`-F` flag. Supported formats are `table` (the default), `html` for a HTML table, `toolkit`/`csv` for CSV suitable for a Toolkit sampler, `markdown`/`md` or `tsv`. If the format is not recognised then the default `table` format is used.
Expand Down
2 changes: 0 additions & 2 deletions gdna/cmd/_docs/report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# `gdna report`

The `gdna report` command runs the configured reports and publishes them to the configured Netprobe to be displayed in the Geneos Active Console.

Command line flags allow you to control the destination as well as the format and which reports to run.
Expand Down
Empty file added gdna/cmd/_docs/restart.md
Empty file.
2 changes: 0 additions & 2 deletions gdna/cmd/_docs/start.md
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.

1 change: 1 addition & 0 deletions gdna/cmd/_docs/stop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stop the running background `gdna` process.
114 changes: 114 additions & 0 deletions gdna/cmd/control.go
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
},
}
7 changes: 7 additions & 0 deletions gdna/cmd/rest.go
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
6 changes: 3 additions & 3 deletions gdna/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ func initConfig(cmd *cobra.Command) {
}

info, _ := dbg.ReadBuildInfo()
log.Info().Msgf("version %s built with %s", cordial.VERSION, info.GoVersion)
log.Info().Msg(deferredlog)
log.Info().Msgf("command %q version %s built with %s", cmd.Name(), cordial.VERSION, info.GoVersion)
log.Debug().Msg(deferredlog)
}

func configReloaded(e fsnotify.Event) {
func configReloaded(_ fsnotify.Event) {
// XXX protect this
cf = nil
initConfig(nil)
Expand Down
Loading

0 comments on commit ee9ec39

Please sign in to comment.