otrs customer db (postgres) update - how to reflect

Moderator: crythias

Post Reply
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

otrs customer db (postgres) update - how to reflect

Post by PhyrePhoX »

Hi guys,

quick question/scenario: OTRS uses a readonly customer database, that i fill/sync with external tools/scripts. I usually run this script at night, followed by a "/usr/share/otrs/bin/otrs.Console.pl Maint::Cache::Delete", so that changes in a customer are directly reflected in the customer information in tickets, and also generic agent/notifications can run properly (for example, when a priority of a customer has changed over night).
However, we now have changes that need to be reflected immediately (e.g. an account manager tells us to flag a customer with a certain flag), and those changes are not reflected in otrs for my agent. Unless i run a cache delete. However, this cache delete is disruptive (e.g. agents see the "otrs daemon is not running" briefly, and i am not sure what other impact they have).
Then i saw you can give the /usr/share/otrs/bin/otrs.Console.pl Maint::Cache::Delete a "--type" parameter, other than
[--type ...] - Define the type of cache which should be deleted (e.g. Ticket or StdAttachment).
I did not find documentation about all the different types of cache there are. Which one would fit my requirement, of deleting the cache from a customer ("the customer database cache")?

Thanks in advance
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: otrs customer db (postgres) update - how to reflect

Post by PhyrePhoX »

or could be the solution the
CacheTTL => 60 * 60 * 24, # use 0 to turn off cache
setting in the config?
Is this the standard value? 24 hours? wow. How dangerous is it turn it off or set it to 5 minutes, do you know?
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
root
Administrator
Posts: 3954
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: otrs customer db (postgres) update - how to reflect

Post by root »

Hi,

It's not dangerous to decrease the CacheTTL, but it might have a (very) bad impact on performance. Your approach with the --type parameter is one I recommend. To see which values are possible just check which directories within var/tmp/CacheFileStorable/ are available. One of my test systems looks like this:

Code: Select all

TEST [znuny@xxx.znuny-managed.com] ~ $ ls -ld var/tmp/CacheFileStorable/Customer*
drwxrws--- 16 znuny  apache  132 Jun 14 06:10 var/tmp/CacheFileStorable/CustomerCompany
drwxrws--- 18 znuny  apache  150 Jun 11  2021 var/tmp/CacheFileStorable/CustomerCompany1
drwxrws--- 17 apache apache  141 Jun 12 00:20 var/tmp/CacheFileStorable/CustomerCompany1_CustomerCompanyList
drwxrws---  3 apache apache   15 Jun 13 10:41 var/tmp/CacheFileStorable/CustomerCompany_CustomerCompanyList
drwxrws--- 13 apache apache  105 Jun 14 10:36 var/tmp/CacheFileStorable/CustomerGroup
drwxrws--- 18 apache apache 4096 Jun 13 13:15 var/tmp/CacheFileStorable/CustomerUser
drwxrws--- 16 znuny  apache  132 Jun 13 16:44 var/tmp/CacheFileStorable/CustomerUser2
drwxrws--- 18 znuny  apache  150 Jun 14 08:29 var/tmp/CacheFileStorable/CustomerUser2_CustomerSearch
drwxrws--- 18 znuny  apache  150 Jun 14 08:29 var/tmp/CacheFileStorable/CustomerUser_CustomerSearch
drwxrws--- 18 znuny  apache  150 Jan 10 15:34 var/tmp/CacheFileStorable/CustomerUserPreferencesDB
TEST [znuny@xxx.znuny-managed.com] ~ $
I would run a one liner like this:

Code: Select all

for type in $(find var/tmp/CacheFileStorable/ -maxdepth 1 -type d \( -name CustomerUser\* -o -name CustomerCompany\* \) -exec basename "{}" \; ) ;do bin/otrs.Console.pl Maint::Cache::Delete --type "$type"; done
- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
PhyrePhoX
Znuny advanced
Posts: 132
Joined: 05 Dec 2007, 10:56
Znuny Version: 5.0.24 (with ITSM Mo

Re: otrs customer db (postgres) update - how to reflect

Post by PhyrePhoX »

Many thanks, roy!

Code: Select all

for type in $(find /usr/share/otrs/var/tmp/CacheFileStorable/ -maxdepth 1 -type d \( -name CustomerUser\* -o -name CustomerCompany\* \) -exec basename "{}" \; ) ;do /usr/share/otrs/bin/otrs.Console.pl Maint::Cache::Delete --type "$type"; done
did the trick. This helps me (and my colleagues) alot!
OTRS 5.0.24 (with ITSM Modules) and Znuny 6.4.4 in staging
Post Reply