Configuration & Administration

Expand all | Collapse all

Zenoss 4.2.5 Change MySQL Server

  • 1.  Zenoss 4.2.5 Change MySQL Server

    Posted 17 days ago
    Hello everybody,

    I am using Zenoss 4.2.5 and would like to use an external MySQL database as the event database.

    I don't know if this is possible. However after analyzing the file $ZENHOME/etc/global.conf

    zodb-db-type mysql
    zodb-host localhost
    zodb-port 3306
    zodb-db zodb
    zodb-user zenoss
    zodb-password PASWWORD
    zodb-admin-user root
    zodb-admin-password
    zodb-cacheservers 127.0.0.1:11211
    zodb-cachesize 1000

    amqphost localhost
    amqpport 5672
    amqpvhost /zenoss
    amqpuser zenoss
    amqppassword PASWWORD
    amqpusessl 0
    amqpadminport 55672
    amqpadminusessl 0

    zep-db-type mysql
    zep-host localhost
    zep-port 3306
    zep-db zenoss_zep
    zep-user zenoss
    zep-password PASWWORD
    zep-admin-user root
    zep-admin-password
    zep-uri http://localhost:8084

    I performed these operations in the remote MySQL:
    - Created zenoss@% and granted the privileges
    - Created root @% and granted privileges

    From the Zenoss server I tested the connection to the remote MySQL from the command line:
    > mysql -uroot -pPASSWORD -h IPADDRESS
    > mysql -uroot -pPASSWORD -h IPADDRESS
    The connection was successful.

    From the Zenoss server I dumped zenoss_zep and uploaded it to the remote MySQL 5.7. The upload was successful

    as a zenoss user I ran the zenoss stop command
    I modified the $ZENHOME/etc/global.conf file as follows:

    zep-db-type mysql
    zep-host REMOTE_MYSQL_IPADDRESS
    zep-port 3306
    zep-db zenoss_zep
    zep-user zenoss
    zep-password PASWWORD
    zep-admin-user root PASSWORD
    zep-admin-password
    zep-uri http://localhost:8084

    as a zenoss user I ran the zenoss start command.

    The Zenoss application starts normally but does not load data from the DB and when it receives a new alarm it is not written to the remote MySQL.

    Am I doing something wrong or is it an operation that is not possible?
    Can you help me please?





    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------


  • 2.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 17 days ago
    Hi, Davide.

    I see that when you tested the connection, you did so as the root user.  When the zeneventserver service writes events, it will use the zenoss user account in the MySQL server.

    If you check the zeneventserver log file, does it complain about connecting to the database?

    ------------------------------
    Michael J. Rogers
    Senior Instructor - Zenoss
    Austin TX
    ------------------------------



  • 3.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 17 days ago
    While we're on the subject of log files, have you checked the .err log on your new MySQL server?

    ------------------------------
    Michael J. Rogers
    Senior Instructor - Zenoss
    Austin TX
    ------------------------------



  • 4.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 15 days ago
      |   view attached
    Hi it's a wrong copy an paste. I have tested zenoss connection too and it works fine.

    In attach the zeneventserver log.

    Thank's

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------

    Attachment(s)

    txt
    zeneventserver_LOG.txt   416 KB 1 version


  • 5.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 15 days ago
    I have eliminated the error referring to the table field named "check_new". This field is used by my external application and I have made sure that its value can also be NULL.

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------



  • 6.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 15 days ago
    But the problem persists.
    I noticed in the log file that there may be a timestamp problem in MySQL. Could it be due to the fact that I am using MySQL version 5.7 and not the 5.5 which uses Zenoss 4.2.5?

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------



  • 7.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 15 days ago
      |   view attached
    Hello,

    having the doubt that it was a problem with the version of the MySQL server, I installed on another virtual machine MySQL 5.5 (the same used by Zenoss 4.2.5). I have the same kind of problems. I attach the log file 06/06/2021 h19: 55

    Thank you

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------

    Attachment(s)

    txt
    zeneventserver_LOG_h1955.txt   444 KB 1 version


  • 8.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 14 days ago
    I don't Know how.....But I just logged into the Zenoss GUI and in the events view there are new alarms and they are present in the remote DB. It would seem that everything is working properly.

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------



  • 9.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 14 days ago
    I noticed that in the zeneventserver log these events are recorded every hour:
    I don't know if this is normal or if something needs to be fixed
    2021-06-06T20:46:53.729 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210605_180000: prune timestamp 2021-06-05 20:46:53.728
    2021-06-06T20:46:54.147 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210606_200000 to table event_time
    2021-06-06T21:46:54.446 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210605_190000: prune timestamp 2021-06-05 21:46:54.446
    2021-06-06T21:46:54.659 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210606_210000 to table event_time
    2021-06-06T22:46:54.875 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210605_200000: prune timestamp 2021-06-05 22:46:54.875
    2021-06-06T22:46:55.106 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210606_220000 to table event_time
    2021-06-06T23:46:55.336 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210605_210000: prune timestamp 2021-06-05 23:46:55.336
    2021-06-06T23:46:55.865 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210606_230000 to table event_time
    2021-06-07T00:46:56.653 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210605_220000: prune timestamp 2021-06-06 00:46:56.653
    2021-06-07T00:46:56.850 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_000000 to table event_time
    2021-06-07T01:46:57.073 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210605_230000: prune timestamp 2021-06-06 01:46:57.073
    2021-06-07T01:46:57.472 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_010000 to table event_time
    2021-06-07T02:46:57.682 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_000000: prune timestamp 2021-06-06 02:46:57.682
    2021-06-07T02:46:57.876 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_020000 to table event_time
    2021-06-07T03:46:58.084 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_010000: prune timestamp 2021-06-06 03:46:58.083
    2021-06-07T03:46:58.364 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_030000 to table event_time
    2021-06-07T04:46:58.580 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_020000: prune timestamp 2021-06-06 04:46:58.58
    2021-06-07T04:46:59.220 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_040000 to table event_time
    2021-06-07T05:46:59.480 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_030000: prune timestamp 2021-06-06 05:46:59.48
    2021-06-07T05:47:00.720 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_050000 to table event_time
    2021-06-07T06:47:00.971 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_040000: prune timestamp 2021-06-06 06:47:00.971
    2021-06-07T06:47:01.185 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_060000 to table event_time
    2021-06-07T07:45:58.827 [ZEP_DATABASE_MAINTENANCE] INFO org.zenoss.zep.dao.impl.DBMaintenanceServiceImpl - Optimizaton of event_summary
    2021-06-07T07:47:01.399 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_050000: prune timestamp 2021-06-06 07:47:01.399
    2021-06-07T07:47:01.645 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_070000 to table event_time
    2021-06-07T08:47:01.927 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_060000: prune timestamp 2021-06-06 08:47:01.927
    2021-06-07T08:47:02.558 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_080000 to table event_time
    2021-06-07T09:47:03.115 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_070000: prune timestamp 2021-06-06 09:47:03.114
    2021-06-07T09:47:03.537 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_090000 to table event_time
    2021-06-07T10:47:03.743 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_080000: prune timestamp 2021-06-06 10:47:03.743
    2021-06-07T10:47:04.080 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_100000 to table event_time
    2021-06-07T11:47:04.712 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_090000: prune timestamp 2021-06-06 11:47:04.712
    2021-06-07T11:47:04.924 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Adding partition p20210607_110000 to table event_time
    





    d

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------



  • 10.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 14 days ago

    Davide,

    I initially suspected this was an event index issue.  It's possible that the events failed to list in the console because the event index was stale or incomplete, but I wasn't able to find evidence in the logs.

    As for the ZEP_EVENT_TIME_PURGER messages, these are completely normal.  Here are the same messages from my system:

    2021-06-07T13:11:34.402 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_120000: prune timestamp 2021-06-06 13:11:34.401
    2021-06-07T13:11:34.402 [ZEP_EVENT_TIME_PURGER] INFO org.zenoss.utils.dao.impl.MySqlRangePartitioner - Pruning table event_time partition p20210606_130000: prune timestamp 2021-06-06 13:11:34.401
    2021-06-07T13:11:34.450 [ZEP_EVENT_ARCHIVE_PURGER] INFO org.zenoss.zep.index.EventIndexDao - Purging events older than Tue Mar 09 13:11:34 UTC 2021

    If the event system appears to be working, you're probably good to go.  If it gives you trouble or certain events cannot be manipulated (closed, ack'd, etc.), you may need to rebuild the event indexes to make sure their synchronized with the database.



    ------------------------------
    Michael J. Rogers
    Senior Instructor - Zenoss
    Austin TX
    ------------------------------



  • 11.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 12 days ago
    Hi Micheal
    Thank you so much for your support. Much appreciated. I was wondering, for my curiosity, what if a second Zenoss Server used the same MySQL server used by the first Zenoss server? Do you think there are problems in the simultaneous use of a single MySQL server from two different Zenoss servers?

    thank's
    Davide

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------



  • 12.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 11 days ago
    Hi Michael,

    I am experiencing that new traps are not showing up in the event console. Even if the trap has been written in the DB. I understood in your previous answer that Sever Zenoss could have this kind of problem. How can i fix it? can you help me?

    Thank you

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------



  • 13.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 11 days ago
    Edited by Davide 11 days ago
    Hi micheal,

    Reading the Zenoss 4.2 administration pdf I noticed that it is possible to recreate the event index by following this procedure:

    zeneventserver stop
    rm -rf $ZENHOME/var/zeneventserver/index
    zeneventserver start


    Nothing has changed. The new traps are not shown in the event console but are present in zenoss_zep [event_summary]. I thought it would be better to rebuild the DB and follow a procedure provided by Jane Curry in the following post Move o Delte all event in Zenoss 4.2.5

    zenoss stop

    zeneventserver-create-db --dbtype=mysql --force

    rm -rf $ZENHOME/var/zeneventserver/* (removes the zep indexes)

    zenoss start

    zenoss start returns the following:
    Daemon: zeneventserver Applying schema version: 1
    ERROR 1045 (28000): Access denied for user 'zenoss'@'IPADDRESS' (using password: YES)
    starting...
    Waiting for zeneventserver to start......
    Daemon: zopectl .
    daemon process started, pid=6754
    Daemon: zenrrdcached starting...
    Daemon: zenhub starting...
    Daemon: zenjobs starting...
    Daemon: zeneventd starting...
    Daemon: zenping starting...
    Daemon: zensyslog starting...
    Daemon: zenstatus starting...
    Daemon: zenactiond starting...
    Daemon: zentrap starting...
    Daemon: zenmodeler starting...
    Daemon: zenperfsnmp starting...
    Daemon: zencommand starting...
    Daemon: zenprocess starting...
    Daemon: zredis starting...
    Daemon: zenjmx starting...
    Daemon: zenpython starting...

    as you can see zeneventserver cannot connect to the DB. From the command line I have verified that the access to zenoss zep is successful as a zenoss user and as a root user using the passwords configured in the file $ZENHOME/etc/global.conf. Both users, zenoss and root, have all the GRANTs in the zenoss DBs

    Maybe the rebuild of the MySQL DB created a new password for the zenoss user? If so, where is it stored by zenoss? In the file $ ZENHOME / etc / global.conf the initial passwords are configured and with which I can access without problems from the command line.







    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------



  • 14.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 11 days ago
    In attach zeneventserver log

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------



  • 15.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 11 days ago
      |   view attached
    In attach zeneventserver log

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------

    Attachment(s)

    txt
    zeneventserver.txt   590 KB 1 version


  • 16.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 10 days ago
    On the MySQL command line, can you do a show grants; and attach the output?

    ------------------------------
    Michael J. Rogers
    Senior Instructor - Zenoss
    Austin TX
    ------------------------------



  • 17.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 7 days ago
    Hi Michael,

    This is the outpuit:

    mysql> show grants;
    +-----------------------------------------------------------------------------------------------------------------+
    | Grants for zenoss@localhost |
    +-----------------------------------------------------------------------------------------------------------------+
    | GRANT PROCESS ON *.* TO 'zenoss'@'localhost' IDENTIFIED BY PASSWORD '*35EB7C1421BF57F9B1ED3D3AAE5A3828557C2435' |
    | GRANT ALL PRIVILEGES ON `zodb`.* TO 'zenoss'@'localhost' |
    | GRANT ALL PRIVILEGES ON `zenoss_zep`.* TO 'zenoss'@'localhost' |
    | GRANT ALL PRIVILEGES ON `zodb_session`.* TO 'zenoss'@'localhost' |
    | GRANT SELECT ON `mysql`.`proc` TO 'zenoss'@'localhost' |
    +-----------------------------------------------------------------------------------------------------------------+
    5 rows in set (0.00 sec)

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------



  • 18.  RE: Zenoss 4.2.5 Change MySQL Server

    Posted 7 days ago
    This is the output for zenoss@%

    mysql> show grants;
    +-------------------------------------------------------------------------------------------------------+
    | Grants for zenoss@% |
    +-------------------------------------------------------------------------------------------------------+
    | GRANT USAGE ON *.* TO 'zenoss'@'%' IDENTIFIED BY PASSWORD '*35EB7C1421BF57F9B1ED3D3AAE5A3828557C2435' |
    | GRANT ALL PRIVILEGES ON `zodb`.* TO 'zenoss'@'%' |
    | GRANT ALL PRIVILEGES ON `zenoss_zep`.* TO 'zenoss'@'%' |
    | GRANT ALL PRIVILEGES ON `zodb_session`.* TO 'zenoss'@'%' |
    | GRANT SELECT ON `mysql`.`proc` TO 'zenoss'@'%' |
    +-------------------------------------------------------------------------------------------------------+
    5 rows in set (0.00 sec)

    ------------------------------
    Davide Mancosu
    system administartor
    Tiscali Italia S.p.A.
    Cagliari
    ------------------------------