Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring service/process status #873

Closed
AckRiteris opened this issue Sep 2, 2016 · 12 comments
Closed

Monitoring service/process status #873

AckRiteris opened this issue Sep 2, 2016 · 12 comments
Labels

Comments

@AckRiteris
Copy link

Is it possible with default configuration? A simple green/red indicator stating whether process is on or off on the dashboard.

@ktsaou
Copy link
Member

ktsaou commented Sep 2, 2016

You can add the process you are interested in /etc/netdata/apps_groups.conf. This will create a dimension for your app at the applications charts.

Then, you can create a few alarms for the new dimension. You can check if that group has cpu usage, uses memory, has disk activity, has open files, network sockets, pipes, uses swap memory, the number of processes it has, the number of threads, etc.

Assuming that the apps_group.conf for your app will be called myapp, an alarm would look like this:

 alarm: myapp_processes
    on: apps.processes
  calc: $myapp
 every: 10s
  crit: $this = 0
 units: processes
  info: myapp currently running processes

The above will check that myapp has at least a process running.

Similarly, you can check if it has open sockets:

 alarm: myapp_sockets
    on: apps.sockets
  calc: $myapp
 every: 10s
  crit: $this = 0
 units: sockets
  info: myapp currently open sockets

You can even check if it is swapping:

 alarm: myapp_swapping_30min
    on: apps.major_faults
lookup: sum -30m unaligned of myapp
 every: 10s
  crit: $this > 0
 units: major page faults
  info: number of times myapp has swapped memory during the last 30 mins

@ktsaou ktsaou added the question label Sep 2, 2016
@AckRiteris
Copy link
Author

AckRiteris commented Sep 2, 2016

Thanks for alarm examples! I want to show that info live, so which API should I request? I figured out how to check for memory,
<div data-netdata="apps.mem" data-dimensions="httpd"
cpu usage
<div data-netdata="apps.cpu" data-dimension="httpd"
but is there a status check? Would checking thread count be enough?

EDIT: Combined with badges, checking for thread count actually deals with process monitoring quite nicely.
I'm only missing services (iptables for example). Is it possible to monitor that?

@ktsaou
Copy link
Member

ktsaou commented Sep 2, 2016

what you want to monitor from iptables?

If the dashboard is showing a Firewall (netfilter) menu entry, the charts are already there.
However, newer ubuntu and fedora versions have removed /proc/net/stat/nf_conntrack so a new plugin is required. Check #161

@ktsaou
Copy link
Member

ktsaou commented Sep 2, 2016

One solution is to use fireqos for measuring and shaping traffic per port.
Check the demo sites at http://my-netdata.io, they all have QoS monitoring, which provides bandwidth per service.

@AckRiteris
Copy link
Author

AckRiteris commented Sep 2, 2016

Oh, iptables was just an example. For starters, I just want to now if a service is running. In some cases just checking for running threads is enough (my backup software, oracle's pmon (not enough but that's something), httpd threads, etc) but iptables doesn't show up in ps aux output and I'm guessing this is what netdata checks?

In general, will there be (and is it even of any use for netdata) to have binary 0/1 for services to see what's running and what's dead?

To show what I'm trying to do,
image
Instead of "25 threads", I'd just want to know that service is running. Right now it's doing it's job but that could be just ON/OFF instead of # of threads :)

@ktsaou
Copy link
Member

ktsaou commented Sep 2, 2016

but iptables doesn't show up in ps aux output and I'm guessing this is what netdata checks

netdata reads dozens of files in the /proc filesystem, connects to services (databases, web servers, etc), runs commands, etc.

To help you I would need to know your exact need.

Instead of "25 threads", I'd just want to know that service is running. Right now it's doing it's job but that could be just ON/OFF instead of # of threads :)

Sorry. It cannot be done as it is today. However, if you have used the badge of the alarm, the colour is the key. Green = OK, Orange = Warning, Red = Critical.

Keep in mind that you have to <embed src="/api/v1/badge.svg?chart=X&alarm=Y&autorefresh=auto"/> for the badges to auto-refresh.

@AckRiteris
Copy link
Author

Yeah, I read the post about badges and configured/color-coded mine accordingly, thanks for that feature!
Will service status be available in the future or you didn't plan that?

-----Original Message-----
From: "Costa Tsaousis" notifications@github.com
Sent: ‎2016-‎09-‎02 17:45
To: "firehol/netdata" netdata@noreply.github.com
Cc: "AckRiteris" riciuxas@gmail.com; "Author" author@noreply.github.com
Subject: Re: [firehol/netdata] Monitoring service/process status (#873)

but iptables doesn't show up in ps aux output and I'm guessing this is what netdata checks
netdata reads dozens of files in the /proc filesystem, connects to services (databases, web servers, etc), runs commands, etc.
To help you I would need to know your exact need.
Instead of "25 threads", I'd just want to know that service is running. Right now it's doing it's job but that could be just ON/OFF instead of # of threads :)
Sorry. It cannot be done as it is today. However, if you have used the badge of the alarm, the colour is the key. Green = OK, Orange = Warning, Red = Critical.
Keep in mind that you have to for the badges to auto-refresh.

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@ktsaou
Copy link
Member

ktsaou commented Sep 2, 2016

Can you define service status for me?

@AckRiteris
Copy link
Author

Output of service httpd status (as an example) output line reflecting whether service is active, loaded, failed to start or not found at all :) Sorry if I was confusing

-----Original Message-----
From: "Costa Tsaousis" notifications@github.com
Sent: ‎2016-‎09-‎02 19:05
To: "firehol/netdata" netdata@noreply.github.com
Cc: "AckRiteris" riciuxas@gmail.com; "Author" author@noreply.github.com
Subject: Re: [firehol/netdata] Monitoring service/process status (#873)

Can you define service status for me?

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@ktsaou
Copy link
Member

ktsaou commented Sep 2, 2016

Sorry... this is too primitive. netdata focuses on performance monitoring. It can connect on your web server and turn its status metrics to charts, on which you can apply alarms.

@ktsaou
Copy link
Member

ktsaou commented Dec 21, 2016

Cleaning up: I am closing this. If there is something pending, let me know.

@netdata-community-bot
Copy link

This issue has been mentioned on the Netdata Community Forums. There might be relevant details there:

https://community.netdata.cloud/t/process-monitoring/5056/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants