Forum Discussion

Keimond's avatar
Keimond
Icon for Neophyte rankNeophyte
22 days ago

Linux services and autodiscovery

Hey guys, I just wanted to let you know that I took LogicMonitor's default datasource, "Linux_SSH_ServiceStatus", and added auto discovery to it.

The only thing that is needed at the resource or group level is that the following three properties are set:

  • ssh.user
  • ssh.pass
  • linux.ssh.services.regex   ( default: "sshd\.service" )

I published the datasource under 93Y4PC (currently under security review as of this post)

  • The discovery script gets the output of
    systemctl list-units --all --type=service --plain --state=loaded | egrep service
  • Loop through each line of the output and see if it matches the regex from the property, "linux.ssh.services.regex"

 

A person could even set the regex to be ".*" which would grab all of the services.. then turn around and create a filter to exclude certain things. For example if I wanted everything but services with the name ssh in them, I could create a filter that says ##WILDVALUE## not contain ssh.