Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: PFCCWA on July 31, 2018, 09:07:59 AM

Title: Last Login Time for supervisor CME users
Post by: PFCCWA on July 31, 2018, 09:07:59 AM
Hello,

I am trying to find a report or something that would tell me when the last time or date a user(supervisor) logged into CME.
Is this possible?
It would be good enough to know whether they have logged in the last 30 days as well if this is easier to see.
We have CCA, ICON and access to Configuration Server tables but cannot see anything to obtain this particular data.

thanks.
Title: Re: Last Login Time for supervisor CME users
Post by: vmc on July 31, 2018, 09:15:06 AM
I maybe wrong but that's likely only going to show up in the confserv logs unless you have some auditing solution installed as well to catch any changes they make.

Sent from my Redmi Note 3 using Tapatalk

Title: Re: Last Login Time for supervisor CME users
Post by: cavagnaro on July 31, 2018, 03:16:15 PM
No DB stores that info, unless you made something customized for it based on CFGSERVER logs as vmc indicated
Title: Re: Last Login Time for supervisor CME users
Post by: zwerg82 on August 01, 2018, 07:34:57 PM
You can enable Last Login option on config server.
But it might not help you as it only tracks the actual last log in for the user. Means if the supervisor uses WDE after CME it will show the WDE login.

It might work if you create a specific csproxy for CME logins, enable last login, and don’t use last login for all other CSPs.



Gesendet von iPhone mit Tapatalk
Title: Re: Last Login Time for supervisor CME users
Post by: cavagnaro on August 01, 2018, 09:58:12 PM
https://docs.genesys.com/Documentation/System/8.5.x/SDG/LLogIn
This?



Title: Re: Last Login Time for supervisor CME users
Post by: zwerg82 on August 04, 2018, 07:14:37 AM
Yes, but I’m not sure whether he can achieve exactly what he aims for.

It will show one line per username with an associated timestamp and application.

If SVs are using default for CME, GA and GAX it would show default as application.

I’ve used LastLogin to a achieve a different goal, I was mainly using it for cleaning up accounts which were not used for > 6 months.

Cheers


Gesendet von iPhone mit Tapatalk
Title: Re: Last Login Time for supervisor CME users
Post by: cavagnaro on August 04, 2018, 04:16:21 PM
Yeah, OP request needs a log collector. There is no other way

Enviado de meu E6633 usando o Tapatalk

Title: Re: Last Login Time for supervisor CME users
Post by: PFCCWA on August 06, 2018, 12:47:34 PM
[quote author=zwerg82 link=topic=11072.msg50359#msg50359 date=1533366877]

It will show one line per username with an associated timestamp and application.


[/quote]

Hello,

where is this information containing the timestamp/application? is it reportable?

thanks
Title: Re: Last Login Time for supervisor CME users
Post by: cavagnaro on August 06, 2018, 12:52:10 PM
No,will be shown just at the GUI
Please read the link I shared

Enviado de meu E6633 usando o Tapatalk

Title: Re: Last Login Time for supervisor CME users
Post by: zwerg82 on August 06, 2018, 02:07:21 PM
It's stored in the Configuration Database.

It's in the table "CFG_HDB_LAST_LOGIN"

To have a view which is telling you something you could use the following sql statement to check:

[code]SELECT
  CFG_PERSON.USER_NAME,
  CFG_PERSON.EMPLOYEE_ID,
  CFG_PERSON.LAST_NAME,
  CFG_PERSON.FIRST_NAME,
  decode(CFG_PERSON.STATE,1,'enabled',2,'disabled') as STATE,
  decode(CFG_PERSON.IS_AGENT,1,'NONAGENT',2,'AGENT') as PERSON_TYPE,
  to_date('1970-01-01','YYYY-MM-DD') + numtodsinterval(LOGIN_TIME,'SECOND') AS LastLogin,
  CFG_APPLICATION.NAME AS APPLICATION
FROM
  CFG_PERSON
  LEFT JOIN
    CFG_HDB_LAST_LOGIN
    ON CFG_PERSON.DBID = CFG_HDB_LAST_LOGIN.PERSON_DBID
  LEFT JOIN
    CFG_APPLICATION
    ON CFG_APPLICATION.DBID = CFG_HDB_LAST_LOGIN.APP_DBID
ORDER BY LastLogin ASC;
[/code]
Title: Re: Last Login Time for supervisor CME users
Post by: cavagnaro on August 06, 2018, 03:46:10 PM
So it does have an historical option???
Title: Re: Last Login Time for supervisor CME users
Post by: PFCCWA on August 06, 2018, 03:57:33 PM
Yes!
Have just tested and using the CFG_HDB_LAST_LOGIN table I can report on the information required.
The login time itself is UTC so needs a conversion , otherwise reporting is available.
Title: Re: Last Login Time for supervisor CME users
Post by: hsujdik on August 06, 2018, 05:58:11 PM
Sorry for the delayed post.
If you need historical reporting on this:

On Configuration Server Application (confserv):
1. make sure the option log\print-attributes is set to true;
2. Set the option log-extended\level-reassign-22121 to 'standard' (without the quotes);
3. Make sure the Configuration Server application has a connection to the Log Events message server;
4. Confirm the option log\standard has 'network' on its destinations (without the quotes).

On the Log Events Message Server Application:
1. Confirm it has a DAP in its connections to the Log Database (or it has the DBServer options pointing to the Log Database);
2. Make sure the option messages\db_storage is set to true.

On the Log Database, perform the following query (assuming Oracle DBMS):
select to_char(lm.timegenerated, 'yyyy-mm-dd hh24:mi:ss') as logintime, lau.attr_value as username, lap.attr_value as application_, lah.attr_value as hostname, lm.messagetext
from gen_log.g_log_messages lm
inner join gen_log.g_log_attrs lau on lau.LRID = lm.id and lau.attr_name = 'USER'
inner join gen_log.g_log_attrs lap on lap.lrid = lm.id and lap.attr_name = 'APPNAME'
inner join gen_log.g_log_attrs lah on lah.lrid = lm.id and lah.attr_name = 'HOST'
where lm.message_id = 22121;
Title: Re: Last Login Time for supervisor CME users
Post by: zwerg82 on August 08, 2018, 08:11:21 AM
Thx for this. It works! just tested it in my lab.

Best regards
Title: Re: Last Login Time for supervisor CME users
Post by: cavagnaro on August 08, 2018, 03:10:29 PM
Nice! 2 solutions for a problem!
Learned new stuff  8)
Thanks guys
Title: Re: Last Login Time for supervisor CME users
Post by: hsujdik on August 08, 2018, 08:57:16 PM
There is another option for historical reporting that I just thought about (the problem is solved already, but just for a matter of keeping it recorded here):

You could create a Database Trigger that runs after UPDATEs on the table CFG_HDB_LAST_LOGIN and save the data of the new values on a customized table. That way, you can record each login of a person, and have control of the retention rules.
Title: Re: Last Login Time for supervisor CME users
Post by: zwerg82 on August 09, 2018, 05:18:15 AM
I thought of triggers too, but if you have both solutions enabled, you have:

1. all logins in log db, and you can configure how long you want to store those by defining it in your purge job (cat 2, prio 2)

2. in config db you have the actual last login for every user, which helps to identify „dead“ accounts.

Wouldn’t it make more sense to do the trigger on log db? Especially because it gives you the ip?


Title: Re: Last Login Time for supervisor CME users
Post by: Kubig on August 09, 2018, 10:37:04 AM
I am not sure about the table CFG_HDB_LAST_LOGIN  whether contains all attempts to log into Genesys environment as I saw a few installation where this table was always empty (even the HDB was enabled). So I would not rely on it
Title: Re: Last Login Time for supervisor CME users
Post by: zwerg82 on August 09, 2018, 11:17:03 AM
At least for me it's tracking all logins for now in a test environment.
If the customers are using CSProxies they have to be configured to sync this information with confserv.

I have to admit , that I like the solution via log db more.
Title: Re: Last Login Time for supervisor CME users
Post by: hsujdik on August 09, 2018, 06:55:27 PM
[quote author=zwerg82 link=topic=11072.msg50411#msg50411 date=1533813423]
At least for me it's tracking all logins for now in a test environment.
If the customers are using CSProxies they have to be configured to sync this information with confserv.

I have to admit , that I like the solution via log db more.
[/quote]

Just an additional info for that solution, then:

The Log DB does not automatically purge by default. The administrator is reposible for either run the Log DB Maintenance Wizard or create an automated job for purging old data.
In that case, it is interesting to include a "WHERE" clause in order not to delete the records which have the messageid = 22121 or else this historical report would be compromised


Edit: I just realized you have already added that note :)