New Collector - monitoring process cpu

I’m having trouble creating a working chart.
I’ve created collector that needs to monitor a specific process every second,
it’s like the Apps collector but I need only one app(process)
after the collector will be updated, i’ll create alarm which will send notifications every time the process started/ended/stuck.

That’s what I’ve done:

from bases.FrameworkServices.SimpleService import SimpleService

        "options": ["Darknet Process Monitoring", "Darknet Process", "percentage", "apps", "apps.cpu",  "stacked"],
        "lines": [
            ["darknet", 'darknet', 'absolute']


class Service(SimpleService):
    def __init__(self, configuration=None, name=None):
        SimpleService.__init__(self, configuration=configuration, name=name)
        self.order = ORDER
        self.definitions = CHARTS
        self.lower = self.configuration.get('lower', 0)
        self.upper = self.configuration.get('upper', 1000)

    def check():
        return True


    def logMe(self,msg):

    def calculate_data(self):
        for metric in self.process_metrics:

    def get_data(self):
        #The data dict is basically all the values to be represented
        # The entries are in the format: { "dimension": value}
        #And each "dimension" should belong to a chart.
        data = dict()


        data['darknet'] = self.process_data["cpu"]

        return data

Maybe you can help?
I’m not sure what I need to write to see the relevant data.
Thank you.

Hi, @Alisa_Arshansky.

Apps plugin is able to collect metrics for one process too, you just need to be specific when setting the value of a “group”. See some examples of groups that catch a specific process.

What help do you mean? Your collector doesn’t work or it works but produces wrong values or you can’t create alarms?

My collector work but produces wrong values