- edited description
Commandlines are being matched only to some point from the beginning
Issue #150
resolved
I use a Ubuntu 14.04 LTS 64-bit box and monit v. 5.8.1.
I have a following process running:
root 30802 0.5 8.7 1754072 179988 ? Sl 15:48 0:27 /usr/bin/java -classpath /opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/etc:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/common-data-0.0.1-SNAPSHOT.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/avro-1.7.7.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/jackson-core-asl-1.9.13.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/jackson-mapper-asl-1.9.13.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/paranamer-2.3.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/snappy-java-1.0.5.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/commons-compress-1.4.1.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/xz-1.0.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/kafka_2.10-0.8.1.1.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/metrics-core-2.2.0.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/zookeeper-3.3.4.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/jline-0.9.94.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/jopt-simple-3.2.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/scala-library-2.10.1.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/zkclient-0.3.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/metrics-core-3.1.0.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/spring-context-4.1.4.RELEASE.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/spring-aop-4.1.4.RELEASE.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/aopalliance-1.0.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/spring-beans-4.1.4.RELEASE.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/spring-core-4.1.4.RELEASE.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/spring-expression-4.1.4.RELEASE.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/spring-data-redis-1.4.2.RELEASE.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/spring-context-support-4.0.9.RELEASE.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/spring-tx-4.0.9.RELEASE.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/commons-pool2-2.2.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/jedis-2.5.2.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/logback-classic-1.1.2.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/logback-core-1.1.2.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/slf4j-api-1.7.6.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/jcl-over-slf4j-1.7.2.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/log4j-over-slf4j-1.7.2.jar:/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo/long-appz-namezzzz-0.0.1-SNAPSHOT.jar -Dapp.name=long-appz-namezzzz -Dapp.pid=30802 -Dapp.repo=/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler/repo -Dapp.home=/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler -Dbasedir=/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler eu.xxxxx.yy.zzz.SomeAppzNamezzzz
A rule matching someplace in the end this command line fails:
root@host1:~# monit procmatch "eu.xxxxx.yy.zzz.SomeAppzNamezzzz"
List of processes matching pattern "eu.xxxxx.yy.zzz.SomeAppzNamezzzz":
------------------------------------------
------------------------------------------
Total matches: 0
..while a rule matching someplace in the beginning matches correctly:
root@host1:~# monit procmatch "/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler"
List of processes matching pattern "/opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler":
------------------------------------------
/usr/bin/java -classpath /opt/_sources/platform/bi/long-appz-namezzzz/target/appassembler
(...)
------------------------------------------
Total matches: 1
Comments (3)
-
reporter -
monit reads only first 1024 symbols of process cmdline. https://bitbucket.org/tildeslash/monit/src/c6a193b4b334829df6c6d162aefb12970fbbc2e0/src/process/sysdep_LINUX.c?at=master#cl-192
I think this is not proper behavior - because many processes such as java processes (with long classpath) will not properly match
-
repo owner - changed status to resolved
fix Issue
#150: pattern based process check was limited to 1024 characters ... rise limit to 4096→ <<cset 8b6fc2c06a76>>
- Log in to comment
Added my OS and monit version.