NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: How to monitor non-network services on Centos 7?  (Read 307 times)

ZacHow

  • Newbie
  • *
  • Posts: 16
    • View Profile
How to monitor non-network services on Centos 7?
« on: December 27, 2018, 04:31:06 pm »

Hi,

My setup:
Windows server 2012 running NetXMS server (2.2.10)
Centos 7 VM running NetXMS Agent (2.2.10)

On the management console, to monitor a Windows service, we just add "System.servicestate(ServiceName)" and set the expected value. (as shown in attached)

This works fine if the server running the agent is Windows Server 2012/2016/2008R2, but not if the agent is running on a Centos 7 VM.

Any ideas? I've looked all over the forum and the guides but can't seem to find any info!

thanks!
Logged

Tursiops

  • Sr. Member
  • ****
  • Posts: 354
    • View Profile
Re: How to monitor non-network services on Centos 7?
« Reply #1 on: December 28, 2018, 05:22:40 am »

I believe you'll have to create an ExternalParameter for that in your Linux agent configuration.
Something like the following should work (not pretty, I'm sure there's better ways):
Code: [Select]
ExternalParameter=System.LinuxService(*):service $1 status|grep Active|sed "s/.*Active: \(.*\) (.*/\1/"
Once you add that to your configuration (manually or via Agent Configuration Policy for any system determined to be running Linux and an Agent), you can reference it in your DCIs as System.LinuxService(<servicename>).
Logged

ZacHow

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: How to monitor non-network services on Centos 7?
« Reply #2 on: January 08, 2019, 11:51:16 am »

I believe you'll have to create an ExternalParameter for that in your Linux agent configuration.
Something like the following should work (not pretty, I'm sure there's better ways):
Code: [Select]
ExternalParameter=System.LinuxService(*):service $1 status|grep Active|sed "s/.*Active: \(.*\) (.*/\1/"
Once you add that to your configuration (manually or via Agent Configuration Policy for any system determined to be running Linux and an Agent), you can reference it in your DCIs as System.LinuxService(<servicename>).

Thank you very much Tursiops! Worked perfectly. It's strange that this isn't in any of the official documentation, it should probably be added if possible.

Another, slightly more complicated question. We have 2 DB servers running Centos7 and MariaDB. Are there any known monitors for DataBase statistics on Centos7 / MariaDB? Is there any way we can achieve this?

Many thanks,

Zac. 
Logged

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6473
    • View Profile
Re: How to monitor non-network services on Centos 7?
« Reply #3 on: January 11, 2019, 07:43:23 pm »

There is MySQL monitoring subagent, it could possibly work on MariaDB as well, but it seems to be not documented. You can get some information from it's source code here - https://github.com/netxms/netxms/tree/master/src/agent/subagents/mysql and I will ask next week to update administration guide as well.

Best regards,
Victor
Logged