See action log of your server from a terminal

From EN Ikoula wiki
Revision as of 12:03, 21 February 2016 by Ikbot (talk | contribs) (Created page with "<br /> This article has been created by an automatic translation software. You can view the article source :fr:Consulter l'action log de votre serveur depuis un terminal|...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽


This article has been created by an automatic translation software. You can view the article source here.

It may be interesting to view the log of actions of Plesk since such as SSH remote access rather than having to download it from the administration interface of Plesk.

The various elements components the action log are retrieved from the database of Plesk. It will be necessary to connect to this database to run the appropriate query (as a result, the caution is despite the fact that a simple SELECT ).

The query that will allow you to view the log of actions from a terminal is the next :

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa -sNe"SELECT a.date, a.ip_address, a.user, ac.descr, lc.component, lc.old_value, lc.new_value FROM (log_actions a, actions ac) LEFT JOIN log_components lc ON (a.id=lc.action_id) WHERE (ac.id=a.action_id)"

Of course, you can adapt it to your needs (via the MySQL function [between] for example ) or directly use the tool grep.

The following command, for example, will allow you to list connections to the administration interface of Plesk through the utility grep :

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa -sNe"SELECT a.date, a.ip_address, a.user, ac.descr, lc.component, lc.old_value, lc.new_value FROM (log_actions a, actions ac) LEFT JOIN log_components lc ON (a.id=lc.action_id) WHERE (ac.id=a.action_id)" | grep "CP User Login"



You are not allowed to post comments.