[Xymon] Too many procs

Alexander Bech alex at bakarasse.de
Tue May 30 11:01:11 CEST 2017


Have a solution.


# clientlocal.cfg on xymon-server:
toomanyprocs:/usr/sbin/apache2 -k 
start|/usr/sbin/anotherproc|/usr/sbin/anotherproc2


# ps section on xymon-client:

echo "[ps]"
PROCSTOCUT=`cat ${LOGFETCHCFG} | grep "^toomanyprocs:" | awk -F: '{print 
$2}'`
if test -z "$PROCSTOCUT"; then
  ps -Aww f -o 
pid,ppid,user,start,state,pri,pcpu,time:12,pmem,rsz:10,vsz:10,cmd
else
  ps -Aww f -o 
pid,ppid,user,start,state,pri,pcpu,time:12,pmem,rsz:10,vsz:10,cmd | 
egrep -v "${PROCSTOCUT}"
  ORIGIFS=${IFS}; IFS="|"
  for PROC in ${PROCSTOCUT}
  do
     ps -Aww f -o 
pid,ppid,user,start,state,pri,pcpu,time:12,pmem,rsz:10,vsz:10,cmd | grep 
"${PROC}" | grep -v grep | head -n 2
  done
fi
IFS=${ORIGIFS}

Result: only two lines in client message.

Am 24.05.2017 um 21:22 schrieb Alex:
>
> Am 24.05.2017 um 14:53 schrieb Jeremy Laidman:
>
>> That's a lot of processes! I'm guessing they're actually threads 
>> rather than processes, but the "ps" listing in Xymon is showing the 
>> threads separately. Do all of the httpd processes have the same 
>> process ID?
>>
> There are apache2 prefork processes.
> www-data 27440  0.0  0.0  71164  4192 ?        S    May23   0:00 
> /usr/sbin/apache2 -k start
> www-data 27441  0.0  0.0  71164  4192 ?        S    May23   0:00 
> /usr/sbin/apache2 -k start
> www-data 27442  0.0  0.0  71164  4192 ?        S    May23   0:00 
> /usr/sbin/apache2 -k start
> www-data 27443  0.0  0.0  71164  4192 ?        S    May23   0:00 
> /usr/sbin/apache2 -k start
> www-data 27444  0.0  0.0  71164  4192 ?        S    May23   0:00 
> /usr/sbin/apache2 -k start
>
> It is a webserver for presentation of election results.
> It must concurrently satisfy a great number of visitors on the 
> election day.
>
>> You might be able to have the threads collapsed into a single line in 
>> the process listing by adjusting the "ps" command line on your 
>> client. What OS are you running? On Linux, the "-T" switch enables 
>> displaying of separate threads, so if that's in your Xymon client 
>> settings, you would want to remove that.
>>
>> You can also increase the limit for client messages by adjusting 
>> MAXMSG_CLIENT in xymonserver.cfg. But better to reduce the message 
>> size than increase the limit, if you're able to.
> I try my best.
>>
>> J
>>
>>
>> On 24 May 2017 at 21:50, Alexander Bech <alex at bakarasse.de 
>> <mailto:alex at bakarasse.de>> wrote:
>>
>>     Hi all,
>>
>>     We have several webserver with 24000 started apache2 processes.
>>     Xymonclient message is too large and are dropped.
>>
>>     Does anyone have experience with this problem?
>>
>>
>>     Regards,
>>     Alex
>>
>>
>>     _______________________________________________
>>     Xymon mailing list
>>     Xymon at xymon.com <mailto:Xymon at xymon.com>
>>     http://lists.xymon.com/mailman/listinfo/xymon
>>     <http://lists.xymon.com/mailman/listinfo/xymon>
>>
>>
>
>
>
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20170530/4071a14f/attachment.html>


More information about the Xymon mailing list