User Login Notification

Hi, there
It is it possible to setup user login notification, so that the latest login by any user will be notified to the system admin? If yes, how to configure it? Thanks for your support

Hi

hum with DHIS2 I don’t know if it’s possible. However, you can write a script using the DHIS2 APIs. I did something like this when a user is edited, all admins get an email notification.

1 Like

Hi @kazem_zendehdel ,
I took a slightly different approach here and created a small Python script to export data from the “Data Statistics” report in DHIS2 as a Prometheus metric. You can these use Grafana to visualize how many active users ( Last hour, Today, Last 2 days, etc) over time. In large systems with many users, sending an email each time a user logs in would result in (potentially thousands) of emails a day. Grafana has quite comprehensive alerting functionality, so you could also use it to send an email or other type of message via different channels (Telegram, SMS, etc).

Here is an example of the output from Grafana to help you see how many users you have logging into the system.

image

There is a very comprehensive guide to getting Prometheus/Grafana setup to monitor DHIS2 here.

Best regards,
Jason