Page 2 of 2

Re: Monitoring Microsoft Azure from Nagiosxi

Posted: Mon Sep 17, 2018 11:54 am
by mohan23
Before we proceed with this wizard, would like to know how will be the traffic between nagios and Cloud VM and is there any impact to the VM in terms of performance and could you let me know how this monitoring works using NCPD for Cloud VM. Like how NPCD and nagios get these metrics of VM .

Re: Monitoring Microsoft Azure from Nagiosxi

Posted: Mon Sep 17, 2018 12:43 pm
by lmiltchev
NCPA uses psutil on the backend and it doesn't require much processing power. NCPA is a very light-way agent, and you won't notice any performance issues with it.

Re: Monitoring Microsoft Azure from Nagiosxi

Posted: Mon Sep 17, 2018 12:57 pm
by mohan23
So if it is windows VM , do we need to install psutil separately apart from NCPA installation or NCPA package contains psutil in it? How about for Linux VM?

Re: Monitoring Microsoft Azure from Nagiosxi

Posted: Mon Sep 17, 2018 1:31 pm
by lmiltchev
You don't need to install anything separately, including the psutil package. It's all done automatically, when you install NCPA. NCPA will work on Windows, Linux, and Mac OS X. There are links to the specific documentation sections for different operating systems here:

https://www.nagios.org/ncpa/#docs

Re: Monitoring Microsoft Azure from Nagiosxi

Posted: Mon Sep 17, 2018 1:42 pm
by mohan23
Thank you for all the information that you have shared. I have one more query on how we can monitor process status that have argument or command line?

Re: Monitoring Microsoft Azure from Nagiosxi

Posted: Mon Sep 17, 2018 2:05 pm
by lmiltchev
The filter parameters for processes are described in our documentation here:

https://www.nagios.org/ncpa/help.php#ap ... -processes

You could use something like this:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H <remote server ip address> -t '<token>' -M 'processes' -q 'cmd=<command>,match=search'
If the command is too long and complicated, the check may fail unless you figure out how to do the escaping, however you have an option to use many "keywords", that are part of your command. For example, if you had a command like this one:

Code: Select all

"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe -contentproc --channel=7840.1.1472066713\\529801474 -childID 1 -isForBrowser -prefsHandle 1236 -prefsLen 13176 -schedulerPrefs 0001,2 -parentBuildID 20180830143136 -greomni C:\\Program Files (x86)\\Mozilla Firefox\\omni.ja -appomni C:\\Program Files (x86)\\Mozilla Firefox\\browser\\omni.ja -appdir C:\\Program Files (x86)\\Mozilla Firefox\\browser - 7840 \\\\.\\pipe\\gecko-crash-server-pipe.7840 1860 tab"
you could use parts of it in your check:
"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe -contentproc --channel=7840.1.1472066713\\529801474 -childID 1 -isForBrowser -prefsHandle 1236 -prefsLen 13176 -schedulerPrefs 0001,2 -parentBuildID 20180830143136 -greomni C:\\Program Files (x86)\\Mozilla Firefox\\omni.ja -appomni C:\\Program Files (x86)\\Mozilla Firefox\\browser\\omni.ja -appdir C:\\Program Files (x86)\\Mozilla Firefox\\browser - 7840 \\\\.\\pipe\\gecko-crash-server-pipe.7840 1860 tab"
Example:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -M 'processes' -q 'cmd=firefox.exe,cmd=channel=7840.1.1472066713,match=search'
You could add more keywords/filters to your check if you need to narrow it down:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -M 'processes' -q 'cmd=<keyword-1>,cmd=<keyword-2>,<keyword-3>,<keyword-4>,match=search'
Hope this makes sense.

Re: Monitoring Microsoft Azure from Nagiosxi

Posted: Mon Sep 17, 2018 8:53 pm
by mohan23
If I use like cmd=chrome.exe, cmd="*.regex.*", will this kind of regex work?

Re: Monitoring Microsoft Azure from Nagiosxi

Posted: Tue Sep 18, 2018 11:24 am
by lmiltchev
When you said:
cmd=chrome.exe, cmd="*.regex.*"

you probably ment
'cmd=chrome.exe,match=regex'.

Yes, this should work fine:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t '<your token>' -M 'processes' -q 'cmd=chrome.exe,match=regex'