How to configure zorka agent with zabbix without tomcat or any web container

578 views
Skip to first unread message

MKumar

unread,
Jul 31, 2015, 11:29:04 AM7/31/15
to Zorka Users
Hi,

How i can configure zorka agent with Zabbix outside of any web container?

Even I have configured the zorka.properties in order to work with zabbix.

Zorka properties file:
#Example: Apache Tomcat configuration with zabbix, bsh file is not required if you have created the items in zabbix
#all the cases you to enable this property file in zorka.property.
scripts = apache/tomcat.bsh, zabbix.bsh

#Zabbix Active Agent
 zabbix.active = yes

#Zabbix Server's Address (IP:Port) - here I'm using test environment hence server address is te1.oss-hub.uk3.ribob01.net and the port is 10051
zabbix.active.server.addr = te1.oss-hub.uk3.ribob01.net:10051

#Add IP addresses of your zabbix servers here.
#Only servers from this list will be allowed to access agent using zabbix protocol.
zabbix.server.addr = 127.0.0.1,te1.oss-hub.uk3.ribob01.net

#Enter name of your application and host here.
#Should be unique for every monitored application.

My question is:
1. I would like to know about how i can run zorka agent with zabbix without tomcat?

NOTE: zorka agent deployed under toncat directory
2. if i'm not writing any bhs file also then why we need to uncomment scripts = apache/tomcat.bsh, zabbix.bsh  in zorka.properties file (that means i do not have any bhs file under zorka\scripts directory)? 
and if we only uncomment this line in zorka.properties file zorka is sending the data to zabix.

If i'm not uncommenting scripts = apache/tomcat.bsh, zabbix.bsh its throughing an below error:

2015-07-31 12:52:33 DEBUG ZorkaBshWorker Error evaluating expression 'jvm.memutil("PS Perm Gen")' [java.util.concurrent.ExecutionException: com.jitlogic.zorka.deps.bsh.EvalError: Sourced file: inline evaluation of: ``jvm.memutil("PS Perm Gen");'' : Attempt to resolve method: memutil() on undefined variable or class name: jvm : at Line: 1 : in file: inline evaluation of: ``jvm.memutil("PS Perm Gen");'' : jvm .memutil ( "PS Perm Gen" ) 
]
java.util.concurrent.ExecutionException: com.jitlogic.zorka.deps.bsh.EvalError: Sourced file: inline evaluation of: ``jvm.memutil("PS Perm Gen");'' : Attempt to resolve method: memutil() on undefined variable or class name: jvm : at Line: 1 : in file: inline evaluation of: ``jvm.memutil("PS Perm Gen");'' : jvm .memutil ( "PS Perm Gen" ) 

at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:202)
at com.jitlogic.zorka.core.ZorkaBshWorker.run(ZorkaBshWorker.java:95)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.jitlogic.zorka.deps.bsh.EvalError: Sourced file: inline evaluation of: ``jvm.memutil("PS Perm Gen");'' : Attempt to resolve method: memutil() on undefined variable or class name: jvm : at Line: 1 : in file: inline evaluation of: ``jvm.memutil("PS Perm Gen");'' : jvm .memutil ( "PS Perm Gen" ) 

at com.jitlogic.zorka.deps.bsh.UtilEvalError.toEvalError(UtilEvalError.java:82)
at com.jitlogic.zorka.deps.bsh.UtilEvalError.toEvalError(UtilEvalError.java:87)
at com.jitlogic.zorka.deps.bsh.interpreter.BshEvaluatingVisitor.visit(BshEvaluatingVisitor.java:1453)
at com.jitlogic.zorka.deps.bsh.ast.BSHMethodInvocation.accept(BSHMethodInvocation.java:46)
at com.jitlogic.zorka.deps.bsh.interpreter.BshEvaluatingVisitor.evalPrimaryExpr(BshEvaluatingVisitor.java:1521)
at com.jitlogic.zorka.deps.bsh.interpreter.BshEvaluatingVisitor.visit(BshEvaluatingVisitor.java:1540)
at com.jitlogic.zorka.deps.bsh.ast.BSHPrimaryExpression.accept(BSHPrimaryExpression.java:36)
at com.jitlogic.zorka.deps.bsh.Interpreter.eval(Interpreter.java:663)
at com.jitlogic.zorka.deps.bsh.Interpreter.eval(Interpreter.java:757)
at com.jitlogic.zorka.deps.bsh.Interpreter.eval(Interpreter.java:746)
at com.jitlogic.zorka.core.ZorkaBshAgent.eval(ZorkaBshAgent.java:138)
at com.jitlogic.zorka.core.ZorkaBshWorker$1.call(ZorkaBshWorker.java:87)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
... 3 more
Caused by: com.jitlogic.zorka.deps.bsh.UtilEvalError: Attempt to resolve method: memutil() on undefined variable or class name: jvm
at com.jitlogic.zorka.deps.bsh.Name.invokeMethod(Name.java:824)
at com.jitlogic.zorka.deps.bsh.interpreter.BshEvaluatingVisitor.visit(BshEvaluatingVisitor.java:1429)
... 13 more

2015-07-31 12:52:33 DEBUG ZabbixActiveTask Task response: zorka.jmx["java","java.lang:name=PS Eden Space,type=MemoryPool","Usage","used"] -> ZBX_NOTSUPPORTED
{noformat}

Rafal Lewczuk

unread,
Aug 1, 2015, 1:34:54 AM8/1/15
to Zorka Users

So you're trying to monitor Cassandra database with Zorka ? Unfortunately this is not a HTTP container but some metrics will be still available.

I think you can remove tomcat.bsh - at least unless Cassandra uses embedded Tomcat internally. But you need to add jvm.bsh script as it contains definitions of basic functions, like jvm.memutil[]. Also, add the following line to zorka.properties:

zorka.mbs.autoregister = yes

This enables autoregistration of platform mbean server in monitored JVM.

Regards,
rle

MKumar

unread,
Aug 4, 2015, 6:50:52 AM8/4/15
to Zorka Users
Thanks Rle,

Yes, I'm trying to monitor Cassandra database with zorka and also I'm trying to monitor some other java application as well.

Referring to your comment, that means after enabling autoregister I will be able to monitor other application through zorka.

but where i need to copy zorka agent in the linux directory and how i can ensure that zorka.jar is invoked by jvm, where do I have to add below line in order to invoke zorka.jar file? 

-javaagent:/home/ec2-user/zorka/zorka.jar=/home/ec2-user/zorka"

Rafal Lewczuk

unread,
Aug 5, 2015, 1:35:43 PM8/5/15
to Zorka Users
It doesn't matter where agent files are as long as they are available to JVM ($ZORKA_HOME/log must be writable) and -javaagent... option is enabled. I usually place zorka directory somwehere in application server tree but if you have no application server, you can place it anywhere.

Autoregistering means that agent will automatically find and register platform mbean server, thus all JVM  mbeans will become visible to zabbix.


Message has been deleted
Message has been deleted

MKumar

unread,
Aug 12, 2015, 12:42:15 PM8/12/15
to Zorka Users
Hi Rafal,

I have placed my zorka agent into \home directory and have configured the zorka.properties file accordingly 

and also i have added an item in zabbix with key = jvm.memutil[\"Perm Gen\"] 

now my question is to you is how i can ensure that zorka agent is running?

when i'm running -javaagent:/root/zorka/zorka.jar command its throwing me an exception 
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source)
        at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source)
Caused by: java.lang.NullPointerException
        at com.jitlogic.zorka.common.util.ZorkaUtil.path(ZorkaUtil.java:753)
        at com.jitlogic.zorka.agent.AgentMain.premain(AgentMain.java:97)

can you please let me know if i'm missing something.



Rafal Lewczuk

unread,
Aug 16, 2015, 5:51:09 PM8/16/15
to Zorka Users
Hi,

You need to add agent home dir to javaagent directive:

-javaagent:/root/zorka/zorka.jar=/root/zorka

Regards,
rle

MKumar

unread,
Aug 19, 2015, 9:42:40 AM8/19/15
to Zorka Users
Thanks Rafal,

One more question,

How I can set log level or how I can change the log level from DEBUG to INFO or any other log level?
and also please let me know how I can set the zorka log file directory out of ZORKA_HOME\log, for an instance /var/log/zorka?

Thanks,

MKumar

unread,
Aug 25, 2015, 7:08:08 AM8/25/15
to Zorka Users
Hi Rafal,


How I can change the default log directory for zorka log file?
for an instance, from ZORKA_HOME\log to any other directory like /var/log/zorka?

Thanks,

MKumar

unread,
Sep 7, 2015, 11:44:54 AM9/7/15
to Zorka Users

Rafal Lewczuk

unread,
Sep 13, 2015, 5:41:52 PM9/13/15
to Zorka Users
Hi,

Log directory is hardcoded to $ZORKA_HOME/log. But on Linux you can remove log directory and then link directory of your choice.

rm -rf $ZORKA_HOME/log
ln -s /var/log/zorka $ZORKA_HOME/log
chown tomcat.tomcat /var/log/zorka


Regards,
rle

MKumar

unread,
Oct 30, 2015, 6:09:35 AM10/30/15
to Zorka Users
Thanks Rafal,

May I know how I can configure zorka properties file in order to keep all log files from zorka instead oof only latest 5 log file.

Rafal Lewczuk

unread,
Nov 3, 2015, 3:36:38 PM11/3/15
to Zorka Users
Hello,

You can use zorka.log.num and zorka.log.size for adjusting number of archived log files and maximum size of a log file.

Regards,
rle

Reply all
Reply to author
Forward
0 new messages