@@ -514,10 +514,6 @@ In addition `keyExpr` can contain expressions fetching record arguments `${n.att
514
514
515
515
It is also possible to attach single-method call statistic directly as mbean attribute:
516
516
517
- spy.zorkaStat(mbsName, beanName, attrName, tstampField, timeField);
518
-
519
- All parameters are the same as in ` toStats() ` method (except for ` keyExpr ` which is missing).
520
-
521
517
#### Intercepting and presenting objects via Zorka Getter
522
518
523
519
Presenting intercepted values as mbean attributes is possible with ` toGetter() ` method:
@@ -527,14 +523,6 @@ Presenting intercepted values as mbean attributes is possible with `toGetter()`
527
523
This will present intercepted object as ValGetter attribute. Each time attribute is accessed (eg. via jconsole),
528
524
Zorka will fetch value using attribute chain ` (attr1, attr2, ...) ` as in ` zorka.jmx() ` call.
529
525
530
- #### Logging collected events via Syslog
531
-
532
- spy.syslogCollector(trapper, expr, severity, facility, hostname, tag)
533
-
534
- Parameter ` trapper ` must be a reference to trapper object obtained using ` syslog.trapper() ` . Parameter ` expr ` is message
535
- template (analogous to ` keyExpr ` in other collectors). Remaining parameters - ` severity ` , ` facility ` , ` hostname ` and
536
- ` tag ` work in the same way as in ` syslog.log() ` method.
537
-
538
526
#### Sending collected events as SNMP traps
539
527
540
528
spy.snmpCollector(trapper, oid, spcode, bindings)
@@ -543,22 +531,24 @@ Parameter `trapper` must be a reference to trapper object obtained using `snmp.t
543
531
` enterprise-oid ` field set to ` oid ` and all variables will have their keys starting with ` oid ` . Traps will be of
544
532
` enterpriseSpecific ` (6) type and specific code will be set to ` spcode ` .
545
533
546
- #### Sending collected events to Zabbix
534
+ #### Using trappers with spy
547
535
548
- spy.zabbixCollector(trapper, expr, key)
549
- spy.zabbixCollector(trapper, expr, host, key)
536
+ spy.trapperCollector(trapper, logLevel, tagExpr, msgExpr, errExpr, errField)
550
537
551
- Parameter ` trapper ` must be a reference to zabbix trapper obtained using ` zabbix.get() ` function. Parameter ` expr ` is
552
- message template (analogous to ` keyExpr ` in other collectors). Parametry `key' refers to zabbix item key that will be
553
- populated. Item must be of proper type (text or number depending on data that is submitted).
538
+ This function creates collector that will send messages via trapper. Several trapper types are available:
554
539
555
- #### Sending collected records to log file
540
+ * file trappers - trappers that log messages to log file;
541
+ * syslog trappers - trappers that send syslog messages;
542
+ * zabbix trappers - trappers that send traps directly to zabbix;
556
543
557
- spy.fileCollector(trapper, expr, logLevel)
544
+ Arguments:
558
545
559
- Parameter ` trapper ` must be a reference to file trapper obtained using ` zorka.fileTrapper() ` , ` zorka.dailyFileTrapper() `
560
- or ` zorka.rollingFileTrapper() ` . Second parameter ` expr ` contains template string used to create log messages. Parameter
561
- ` logLevel ` must be one of: ` zorka.TRACE ` , ` zorka.DEBUG ` , ` zorka.INFO ` , ` zorka.WARN ` , ` zorka.ERROR ` and ` zorka.FATAL ` .
546
+ * ` trapper ` - configured and started trapper object;
547
+ * ` logLevel ` - log level (ZorkaLogLevel constant);
548
+ * ` tagExpr ` - log tag;
549
+ * ` msgExpr ` - log message (if call succeeds);
550
+ * ` errExpr ` - log message (if error occurs);
551
+ * ` errField ` - spy record field that contains intercepted exception object;
562
552
563
553
#### Passing records to another processing chain
564
554
0 commit comments