Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 

Oneliner - Show Management Server Tasks

HeikoAnkenbrand
MVP Diamond
MVP Diamond


This one-liner executes a management API query for successful tasks from the last 30 days, extracts the task name, status, and last modification time from the JSON output, converts the timestamp into a readable date and time format (YYYY-MM-DD HH:MM), and prints the results in aligned columns with fixed widths for better readability.

For example, it shows:

  • When the policy was installed

  • When the SMS database was installed

  • When signature updates were performed

...;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

Disclaimer: Check Point does not provide maintenance services or technical or customer support for third party content provided on this Site, including in CheckMates Toolbox. See also our Third Party Software Disclaimer.




2 Replies

Vincent_Bacher
MVP Silver
MVP Silver

Hi  @HeikoAnkenbrand 

 

nice one.

unfortunately it Will not work with multi domain.  With mdm the oneliner would be much longer and then when working with many cma using -r true is very inefficient.

 

Edith says:

first to loop over cma

mgmt_cli -r true show domains --format json | jq -r '.objects[] | .name'

Then for each domain

while read domain; do
mgmt_cli -r true show tasks status "successful" from-date "$(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%S)" -d "$

...;
TO ACCESS CHECKMATES TOOLBOX it's simple and free


0 Kudos

the_rock
MVP Diamond
MVP Diamond

WOW...AMAZING!

************************


[Expert@CP-MANAGEMENT:0]# mgmt_cli -r true show tasks status "successful" from-date "$(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%S)" --format json | jq -r '.tasks[] | . as $t | ($t["meta-info"]["last-modify-time"]["iso-8601"] | split("T")) as $d | "\($t["task-name"])\t\($t.status)\t\($d[0]) \($d[1][0:5])"' | awk -F'\t' '{ printf "%-80s %-20s %-20s\n", $1, $2, $3 }'
CP-FW-01 - getCores-CMD succeeded 2026-01-27 00:15
CP-FW-01 - getCores-CMD succee

...;
TO ACCESS CHECKMATES TOOLBOX it's simple and free


0 Kudos