I've been busy with this script.
It works, but it isn't sufficient.
I'm monitoring a server which is also running apache with virtual-hosting.
This server sometimes has ill-behaving websites on it and it's always a lot of work to find out who's the culprit.
If a process is using a lot of CPU I want it to list the process (the full process name). This is working alright, but it isn't enough info.
I need the files that are open at that moment.
I'm using lsof for it. I spent a lot of time tweaking the command so it will not burden the server even more. An lsof for only the process ID and letting it only list the fields I really need was my focus.
I thought it was working well, but I was still not getting the right info into zabbix. I thought it had some strange characters, but in the end I found out my 'lsof' just didn't have enough privilege to show me the open files being used by that process......
What is the most elegant way to get the zabbix_agent to run lsof with root privileges? Should I make a wrapper?
It works, but it isn't sufficient.
I'm monitoring a server which is also running apache with virtual-hosting.
This server sometimes has ill-behaving websites on it and it's always a lot of work to find out who's the culprit.
If a process is using a lot of CPU I want it to list the process (the full process name). This is working alright, but it isn't enough info.
I need the files that are open at that moment.
I'm using lsof for it. I spent a lot of time tweaking the command so it will not burden the server even more. An lsof for only the process ID and letting it only list the fields I really need was my focus.
I thought it was working well, but I was still not getting the right info into zabbix. I thought it had some strange characters, but in the end I found out my 'lsof' just didn't have enough privilege to show me the open files being used by that process......
What is the most elegant way to get the zabbix_agent to run lsof with root privileges? Should I make a wrapper?
Comment