Skip to content

zenoss/zenoss-zep

Repository files navigation

==== Zenoss Event Processor (ZEP) README ====

=== Development Configuration ===

Prerequisites:
 * One of:
   - PostgreSQL 8.4 or later.
   - MySQL 5.1 or later.
 * RabbitMQ v2.x

== Configuration ==

1) Create a database for use by ZEP and import the database schema. There is
a script named 'populate_schema.sh' in this directory which can be used to
initialize the database. It assumes the following default settings:

    * DBNAME: 'zenoss_zep'
    * DBUSER: 'root'
    * DBHOST: 'localhost'

To override the default values, run 'populate_schema.sh --help' for usage
information.

== Running ZEP from a standalone build ==

$ mvn clean package
$ mkdir -p ~/zep
$ tar zxvf dist/target/zep-*-webapp.tar.gz -C ~/zep
$ cd ~/zep
--> Edit 'etc/zeneventserver.conf' as needed to configure ZEP.
$ ./bin/zeneventserver-create-db
$ ./bin/zeneventserver start

ZEP will log any problems in 'log/zeneventserver.log'. To update the logging
configuration, edit the 'etc/zeneventserver/logback.xml' file. This file is
reloaded once a minute (or you can restart the ZEP daemon for the changes to
take affect immediately.)

== Running ZEP Unit and Integration Tests ==

To run the integration tests, you need to first create a test RabbitMQ vhost
at /zenoss-test. Run:

# rabbitmqctl add_vhost /zenoss-test
# rabbitmqctl set_permissions -p /zenoss-test zenoss '.*' '.*' '.*'

You must specify the database backend to use for running the integration tests
by specifying the 'dbtype' system property to Maven to either 'postgresql' or
'mysql'. These are the default settings for connecting to the database for each
database type:

  PostgreSQL:
    * zep.jdbc.hostname: localhost
    * zep.jdbc.port: 5432
    * zep.jdbc.admin.username: postgres
    * zep.jdbc.admin.password: postgres
    * zep.jdbc.username: zenoss
    * zep.jdbc.password: zenoss

  MySQL:
    * zep.jdbc.hostname: localhost
    * zep.jdbc.port: 3306
    * zep.jdbc.admin.username: root
    * zep.jdbc.admin.password: <BLANK>
    * zep.jdbc.username: zenoss
    * zep.jdbc.password: zenoss

You may also need to specify redis connection information, if your redis is running on a different host/port.
If you see errors about "JedisConnectionException: Could not get a resource from the pool", this is probably related.
    * zep.redis.host: localhost
    * zep.redis.port: 16379

To specify a system property from the Maven command-line, run:

$ mvn -D<propname>=<propval> [...]

To run the integration tests against MySQL, run:

`./mysql_integration_tests.sh`

You can override any of the default settings for connecting to the database by
specifying the property above either in a Maven profile in
$HOME/.m2/settings.xml or on the command line with the -D option to mvn.

For local testing zenventserver in production mode execute these steps:

* `make build-test-img`
* `./test_deploy.sh`
* `zeneventserver-create-db --dbtype mysql --dbhost mysql --dbadminuser root --dbadminpass root`
* `zeneventserver start or zeneventserver run`
* `curl http://localhost:8084/zeneventserver/api/1.0/heartbeats/`
* `curl http://localhost:8084/zeneventserver/api/1.0/config/`
* `curl http://localhost:8084/zeneventserver/api/1.0/triggers/`
* `curl http://localhost:8084/zeneventserver/api/1.0/stats/`
* `curl http://localhost:8084/zeneventserver/api/1.0/diagnostics/threads/`
* `curl http://localhost:8084/zeneventserver/api/1.0/events/`
* `curl http://localhost:8084/zeneventserver/metrics/metrics?pretty=true`