Forum Discussion

Kelemvor's avatar
Kelemvor
Icon for Expert rankExpert
14 days ago

Can I pull the description of a Linux Server?

Hi,

I'm not a Linux person so this is a bit over my head so thought I'd see if anyone here could help.

We have a service called BrokerAdvanced.  There are multiple instances of this service running on each server that we need to monitor.  I modified one of the Linux Process checks that I found that I think was called LinuxNewProcesses_with_Active_Discovery.

The Arguments and Filter section look like this:

and this is the Collection part:

When the check runs, it does pull data, but it looks like this:

We can't tell which one is which and it one stops and starts again, it gets a new PID so it just falls off the list and looks like a new process.

If I go under Add Other Monitoring, and bring up a list of the running processes.  Instead of organizaing these by PID, we'd like to organize them bu the Description of the item like this:

That way, if one stopped and started, hopefully it would still be under the same item since the description (if that's what it is) would be the same.  I'm not a Linux person and don't really know if we can get that information.  The Name seems to be matching on an OID so maybe there's a different OID to get what we are looking for?  Does anyone have any ideas on if we can do this somehow?

Hopefully that all made sense.

Thanks.

  • You can use the script type for Autodiscover (instead of snmp) and write code to set WildValue to what you want.

    If it helps, here is one that I use for webservices that perhaps you can start with and modify as needed:

    import com.santaba.agent.groovyapi.snmp.Snmp
    def hostname  = hostProps.get("system.hostname")
    
    //Get list of processes from snmp
    def OID_NAME  = ".1.3.6.1.2.1.25.4.2.1.4"
    def OID_PARAM = ".1.3.6.1.2.1.25.4.2.1.5"
    def processPaths  = Snmp.walkAsMap(hostname, OID_NAME, [:], 20000)
    def processParams = Snmp.walkAsMap(hostname, OID_PARAM, [:], 20000)
    
    //Get all unique processes
    def webServices = []
    processPaths.each { pid, name ->
        if (name) {
            webServices << name+"||"+processParams[pid]
        }
    }
    webServices = webServices.unique()
    
    //Report all processes found, use the FILTERS of the DataSource to only get what we want
    webServices.each { entry ->
    
        //AUTODISCOVER: WildValue_ID##WildAlias_Display##Description##WildValue2##auto.propertyhere=somevalue&auto.propertyhere2=somevalue2"
        def (process,param) = entry.tokenize('||')
        println entry+"##"+process             //+"##"+process+" "+param   (if you want to add full command in desc)
    }
    return 0