This commit is contained in:
parent
3688dc01b7
commit
05ed62fda1
2 changed files with 5 additions and 3 deletions
|
@ -33,7 +33,8 @@ func (c *AptCollector) updateInstalledPackages() error {
|
||||||
return fmt.Errorf("failed to run apt list: %w (%s)", err, string(out))
|
return fmt.Errorf("failed to run apt list: %w (%s)", err, string(out))
|
||||||
}
|
}
|
||||||
|
|
||||||
c.installedPackages = len(strings.Split(strings.TrimSpace(string(out)), "\n"))
|
// remove the unstable interface warning
|
||||||
|
c.installedPackages = len(strings.Split(strings.TrimSpace(string(out)), "\n")) - 3
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +51,8 @@ func (c *AptCollector) updatePendingUpdates() error {
|
||||||
return fmt.Errorf("failed to run apt list: %w (%s)", err, string(out))
|
return fmt.Errorf("failed to run apt list: %w (%s)", err, string(out))
|
||||||
}
|
}
|
||||||
|
|
||||||
c.pendingUpdates = len(strings.Split(strings.TrimSpace(string(out)), "\n"))
|
// remove the unstable interface warning
|
||||||
|
c.pendingUpdates = len(strings.Split(strings.TrimSpace(string(out)), "\n")) - 3
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ func (c *SystemdCollector) Collect() interface{} {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *SystemdCollector) getServicesStatus() ([]serviceStatus, error) {
|
func (c *SystemdCollector) getServicesStatus() ([]serviceStatus, error) {
|
||||||
out, err := exec.Command("/sbin/systemctl", "list-units", "--output", "json").CombinedOutput()
|
out, err := exec.Command("/usr/bin/systemctl", "list-units", "--output", "json").CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to run systemd command: %w", err)
|
return nil, fmt.Errorf("failed to run systemd command: %w", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue