- Products
- Learn
- Local User Groups
- Partners
- More
Quantum Spark Management Unleashed!
Introducing Check Point Quantum Spark 2500:
Smarter Security, Faster Connectivity, and Simpler MSP Management!
Check Point Named Leader
2025 Gartner® Magic Quadrant™ for Hybrid Mesh Firewall
HTTPS Inspection
Help us to understand your needs better
CheckMates Go:
SharePoint CVEs and More!
'ntpq -p' shows the current status of ntpd, but it doesn't return a useful exit code when ntpd isn't running. The simplest way to check is probably to see if ntpd is running. 'ps -C ntpd' exits with code 0 if it finds at least one matching process, or code 1 if there aren't any matches.
[Expert@DallasSC]# clish -c "show ntp active"
No
[Expert@DallasSC]# ntpq -p
ntpq: read: Connection refused
[Expert@DallasSC]# echo $?
0
[Expert@DallasSC]# ps -C ntpd
PID TTY TIME CMD
[Expert@DallasSC]# echo $?
1
[Expert@DallasticXL-s01-01:0]# clish -c "show ntp active"
Yes
[Expert@DallasticXL-s01-01:0]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*10.0.1.1 132.163.96.2 2 u 654 1024 377 0.966 0.517 0.830
[Expert@DallasticXL-s01-01:0]# echo $?
0
[Expert@DallasticXL-s01-01:0]# ps -C ntpd
PID TTY TIME CMD
18573 ? 00:00:00 ntpd
[Expert@DallasticXL-s01-01:0]# echo $?
0
About CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY