Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib64 /
nagios /
plugins /
Delete
Unzip
Name
Size
Permission
Date
Action
eventhandlers
[ DIR ]
drwxr-xr-x
2024-03-10 06:52
a2_csf_modsecsync.mvps.mdedi
1.27
KB
-rwxr-xr-x
2025-09-10 09:31
a2_customerview.sh.shared
1.21
KB
-rwxr-xr-x
2025-09-10 09:31
a2_nf_conntrack_count.sh.all
977
B
-rwxr-xr-x
2025-09-10 09:31
a2_postgresql-monitor.shared
1.23
KB
-rwxr-xr-x
2025-09-10 09:31
a2_ram.shared.mdedi.bmi
611
B
-rwxr-xr-x
2025-09-10 09:31
a2_sssd_service_check.sh.all
1.4
KB
-rwxr-xr-x
2025-09-10 09:31
a2_system-updates.all
2.18
KB
-rwxr-xr-x
2025-09-10 09:31
a2_temperature_check.shared.bmi
3.17
KB
-rwxr-xr-x
2025-09-10 09:31
a2_user_mem.shared
1.13
KB
-rwxr-xr-x
2025-09-10 09:31
a2_yum_processes.shared
835
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_backup_network
844
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_backups
2.64
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_cagefs.shared.mvps.mdedi
762
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_cagefs_503_errors
2.96
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_cpdavd_cpu.sh
701
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_cpu_throttle.shared
1.61
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_dbgov.shared
1.23
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_dedi_nvme.mdedi
894
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_devnull-perms.shared
161
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_dimm.shared
1.49
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_disk.sh
2.05
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_dmi.sh.all
2.38
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_dnsdist_cache.sh
298
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_dnsdist_health.sh
270
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_dnsdist_pools.sh
414
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_dnsdist_proc.sh
210
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_dovecot
191
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_extra_ips.shared
854
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_fsstate.sh.all
2.28
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_fw.sh.internal
2.11
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_fw.sh.shared
1.04
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_grub.sh.all
1.22
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_httpdconf.shared
1.16
KB
-rwxr-xr-x
2025-04-15 08:48
check_a2_ifspeed.shared
784
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_imap_auth
1.2
KB
-rwxr-xr-x
2025-02-19 06:03
check_a2_imunify_service
910
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_ipaliases.shared
443
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_ipastatus.sh
2.16
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_ipmi_ip.sh.shared
565
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_jbk_client_limits.sh
1.13
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_jetbackup.sh
12.08
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_largelogs.shared
966
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_le_certs.sh.saltmaster1
1.02
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_load.php
618
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_long_mysql_queries
1.22
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_mailqueue.mvps.mdedi
1.26
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_memlimits-on.shared
458
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_mod-passenger.shared
516
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_monitor-randomize_sqlroot_password_cron.shared.mvps.mdedi
322
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_mysql-monitor.shared.mvps.mdedi
2.62
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_mysql-replication.sh
1.33
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_mysql_tmp_size
242
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_olderdrive_health.all
2.25
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_omni_mysql_backup.sh
1.15
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_omni_pxe_https_check.sh
1.27
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_omni_saltmaster1_authcheck.sh
2.76
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_omni_website.sh
1.01
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_outbound_nat.sh
436
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_packets.mvps
1.73
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_pdns
462
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_php_versions.shared
3.04
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_redis_opcache.shared
1.39
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_salt_minion_service
196
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_salt_running.all
1.83
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_saltmaster_api.sh
1.13
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_smart.py.all
15.54
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_softy_version.sh.shared.mvps.mdedi
1.09
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_vps_memory.sh
411
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_vz7-ikvm_backup.sh
1.2
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_whm_ssl
874
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_whmcs_db_mysql-replication.sh
2.19
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_whmcs_nginx_connections.sh
745
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_whmcs_phpfpm_status.sh
1.6
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_whmcs_th_network.sh
773
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_whmcs_virtualizor.sh
534
B
-rwxr-xr-x
2025-09-10 09:31
check_a2_xen_guest_vm.sh.flexdedi
3.11
KB
-rwxr-xr-x
2025-09-10 09:31
check_a2_zpool.sh
1.31
KB
-rwxr-xr-x
2025-09-10 09:31
check_aad_ldaps
2.09
KB
-rwxr-xr-x
2025-11-03 05:31
check_apache_status.pl
6.09
KB
-rwxr-xr-x
2025-09-10 09:31
check_backup_zpool
17.68
KB
-rwxr-xr-x
2025-09-10 09:31
check_backuply.py
5.77
KB
-rwxr-xr-x
2025-09-10 09:31
check_backups.php
576
B
-rwxr-xr-x
2025-09-10 09:31
check_breeze
2.29
KB
-rwxr-xr-x
2024-04-11 07:27
check_by_ssh
61.16
KB
-rwxr-xr-x
2024-04-11 07:27
check_clamd
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_cluster
40.35
KB
-rwxr-xr-x
2024-04-11 07:27
check_cpu
467
B
-rwxr-xr-x
2025-09-10 09:31
check_cpu_interrupts
353
B
-rwxr-xr-x
2025-09-10 09:31
check_cpu_steal
313
B
-rwxr-xr-x
2025-09-10 09:31
check_crond
227
B
-rwxr-xr-x
2025-09-10 09:31
check_csf
535
B
-rwxr-xr-x
2025-09-10 09:31
check_dhcp
56.75
KB
-rwsr-x---
2024-04-11 07:27
check_dig
56.83
KB
-rwxr-xr-x
2024-04-11 07:27
check_disk
86.26
KB
-rwxr-xr-x
2024-04-11 07:27
check_disk_smb
9.9
KB
-rwxr-xr-x
2024-04-11 07:27
check_dns
249
B
-rwxr-xr-x
2025-09-10 09:31
check_dummy
31.76
KB
-rwxr-xr-x
2024-04-11 07:27
check_elastic
10.49
KB
-rwxr-xr-x
2025-09-10 09:31
check_elasticsearch
335
B
-rwxr-xr-x
2025-09-10 09:31
check_enhance_backup
495
B
-rwxr-xr-x
2025-09-10 09:31
check_exim
184
B
-rwxr-xr-x
2025-09-10 09:31
check_exim_spam.sh
3.44
KB
-rwxr-xr-x
2025-09-10 09:31
check_eximqueue.sh
1.11
KB
-rwxr-xr-x
2025-09-10 09:31
check_file_age
4.95
KB
-rwxr-xr-x
2024-04-11 07:27
check_flexlm
6.35
KB
-rwxr-xr-x
2024-04-11 07:27
check_fping
56.76
KB
-rwsr-x---
2024-04-11 07:27
check_ftp
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_ftpd
199
B
-rwxr-xr-x
2025-09-10 09:31
check_game
44.5
KB
-rwxr-xr-x
2024-04-11 07:27
check_hpjd
52.5
KB
-rwxr-xr-x
2024-04-11 07:27
check_http
106.2
KB
-rwxr-xr-x
2024-04-11 07:27
check_icmp
68.39
KB
-rwsr-x---
2024-04-11 07:27
check_ide_smart
44.57
KB
-rwsr-x---
2024-04-11 07:27
check_imap
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_iowait
587
B
-rwxr-xr-x
2025-09-10 09:31
check_ipaliases.py
2.14
KB
-rwxr-xr-x
2025-09-10 09:31
check_ipmi_sensor
39.45
KB
-rwxr-xr-x
2025-09-10 09:31
check_ircd
6.82
KB
-rwxr-xr-x
2024-04-11 07:27
check_jabber
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_jetbackup.py
12.8
KB
-rwxr-xr-x
2025-09-10 09:31
check_jetbackup_alerts
5.35
KB
-rwxr-xr-x
2025-09-10 09:31
check_jetbackup_license.sh
581
B
-rwxr-xr-x
2025-09-10 09:31
check_jetbackup_mongodb
915
B
-rwxr-xr-x
2025-09-10 09:31
check_jetbackup_queue
4.83
KB
-rwxr-xr-x
2025-09-10 09:31
check_kernel
393
B
-rwxr-xr-x
2025-09-10 09:31
check_ldap
61.07
KB
-rwxr-xr-x
2024-04-11 07:27
check_ldaps
61.07
KB
-rwxr-xr-x
2024-04-11 07:27
check_litespeed
2.43
KB
-rwxr-xr-x
2025-09-10 09:31
check_load
48.39
KB
-rwxr-xr-x
2024-04-11 07:27
check_load.php
422
B
-rwxr-xr-x
2025-09-10 09:31
check_load.py
401
B
-rwxr-xr-x
2025-09-10 09:31
check_local_users
2.01
MB
-rwxr-xr-x
2025-09-10 09:31
check_log
7.99
KB
-rwxr-xr-x
2024-04-11 07:27
check_lvm_thinpools
2.48
KB
-rwxr-xr-x
2025-09-10 09:31
check_mailq
25
KB
-rwxr-xr-x
2024-04-11 07:27
check_managed.sh
5.85
KB
-rwxr-xr-x
2025-09-10 09:31
check_md5files
1.2
KB
-rwxr-xr-x
2025-09-10 09:31
check_md_raid
782
B
-rwxr-xr-x
2025-09-10 09:31
check_megaraid_sas
6.75
KB
-rwxr-xr-x
2025-09-10 09:31
check_memcached
184
B
-rwxr-xr-x
2025-09-10 09:31
check_meminfo
2.79
KB
-rwxr-xr-x
2025-09-10 09:31
check_memory
330
B
-rwxr-xr-x
2025-09-10 09:31
check_memory.py
1.06
KB
-rwxr-xr-x
2025-09-10 09:31
check_mrtg
44.42
KB
-rwxr-xr-x
2024-04-11 07:27
check_mrtgtraf
44.36
KB
-rwxr-xr-x
2024-04-11 07:27
check_mysql
52.91
KB
-rwxr-xr-x
2024-04-11 07:27
check_mysql_all.sh
6.53
KB
-rwxr-xr-x
2025-09-10 09:31
check_mysql_connections
5.89
KB
-rwxr-xr-x
2025-09-10 09:31
check_mysql_engines
603
B
-rwxr-xr-x
2025-09-10 09:31
check_mysql_log
170
B
-rwxr-xr-x
2025-09-10 09:31
check_mysql_memory
733
B
-rwxr-xr-x
2025-09-10 09:31
check_mysql_processes
346
B
-rwxr-xr-x
2025-09-10 09:31
check_mysql_query
48.71
KB
-rwxr-xr-x
2024-04-11 07:27
check_nagios
44.34
KB
-rwxr-xr-x
2024-04-11 07:27
check_nimbus.sh
2.25
KB
-rwxr-xr-x
2025-09-10 09:31
check_nntp
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_nntps
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_nscp_api
5.84
MB
-rwxr-xr-x
2024-10-29 07:19
check_nt
56.65
KB
-rwxr-xr-x
2024-04-11 07:27
check_ntp
56.84
KB
-rwxr-xr-x
2024-04-11 07:27
check_ntp.pl
14.53
KB
-rwxr-xr-x
2024-04-11 07:27
check_ntp_peer
56.91
KB
-rwxr-xr-x
2024-04-11 07:27
check_ntp_time
52.84
KB
-rwxr-xr-x
2024-04-11 07:27
check_nwstat
68.52
KB
-rwxr-xr-x
2024-04-11 07:27
check_oracle
9.27
KB
-rwxr-xr-x
2024-04-11 07:27
check_overcr
48.49
KB
-rwxr-xr-x
2024-04-11 07:27
check_partitions
434
B
-rwxr-xr-x
2025-09-10 09:31
check_pgsql
56.95
KB
-rwxr-xr-x
2024-04-11 07:27
check_ping
60.77
KB
-rwxr-xr-x
2024-04-11 07:27
check_pop
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_postfix
193
B
-rwxr-xr-x
2025-09-10 09:31
check_postfix_queue
930
B
-rwxr-xr-x
2025-09-10 09:31
check_postgres
445.78
KB
-rwxr-xr-x
2025-09-10 09:31
check_procs
60.99
KB
-rwxr-xr-x
2024-04-11 07:27
check_proxmox.sh
928
B
-rwxr-xr-x
2025-09-10 09:31
check_proxmox_backups.sh
1.86
KB
-rwxr-xr-x
2025-09-10 09:31
check_qps_dnsdist.sh
1.68
KB
-rwxr-xr-x
2025-09-10 09:31
check_real
48.59
KB
-rwxr-xr-x
2024-04-11 07:27
check_redis.sh
175
B
-rwxr-xr-x
2025-09-10 09:31
check_resolver.py
3.27
KB
-rwxr-xr-x
2025-09-10 09:31
check_rpc
9.45
KB
-rwxr-xr-x
2024-04-11 07:27
check_rpmdb
690
B
-rwxr-xr-x
2025-09-10 09:31
check_sensors
1.59
KB
-rwxr-xr-x
2024-04-11 07:27
check_service.sh
9.94
KB
-rwxr-xr-x
2025-09-10 09:31
check_simap
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_smart.pl
35.16
KB
-rwxr-xr-x
2025-09-10 09:31
check_smartarray.py
10.07
KB
-rwxr-xr-x
2025-09-10 09:31
check_smartermail_queue
1.5
KB
-rwxr-xr-x
2025-09-10 09:31
check_smtp
69.23
KB
-rwxr-xr-x
2024-04-11 07:27
check_snmp
77.59
KB
-rwxr-xr-x
2024-04-11 07:27
check_spop
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_ssh
48.59
KB
-rwxr-xr-x
2024-04-11 07:27
check_ssmtp
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_sssd
1.32
KB
-rwxr-xr-x
2025-09-10 09:31
check_supervisord.py
15.71
KB
-rwxr-xr-x
2025-09-10 09:31
check_swap
44.33
KB
-rwxr-xr-x
2024-04-11 07:27
check_tcp
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_time
48.55
KB
-rwxr-xr-x
2024-04-11 07:27
check_tmp
210
B
-rwxr-xr-x
2025-09-10 09:31
check_udp
61.13
KB
-rwxr-xr-x
2024-04-11 07:27
check_ups
52.61
KB
-rwxr-xr-x
2024-04-11 07:27
check_users
40.2
KB
-rwxr-xr-x
2024-04-11 07:27
check_vm_status.sh
635
B
-rwxr-xr-x
2025-09-10 09:31
check_wave
3.19
KB
-rwxr-xr-x
2024-04-11 07:27
check_webserver_status
2.93
KB
-rwxr-xr-x
2025-09-10 09:31
check_yum_updates
600
B
-rwxr-xr-x
2025-09-10 09:31
check_zfs
17.68
KB
-rwxr-xr-x
2025-09-10 09:31
check_zpool_usage.sh
885
B
-rwxr-xr-x
2025-09-10 09:31
md5list
61
B
-rw-r--r--
2025-09-10 09:31
negate
40.18
KB
-rwxr-xr-x
2024-04-11 07:27
urlize
35.97
KB
-rwxr-xr-x
2024-04-11 07:27
utils.pm
2.05
KB
-rw-r--r--
2024-04-11 07:27
utils.sh
2.73
KB
-rwxr-xr-x
2024-04-11 07:27
vz7_check_a2_backup_timer_enabled.sh
605
B
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_backups-check.sh
8.4
KB
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_backups-running.sh
2.18
KB
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_fw.sh
1.37
KB
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_ifspeed.sh
1.04
KB
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_license.sh
749
B
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_template_count.sh
856
B
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_templates_mount.sh
940
B
-rwxr-xr-x
2025-09-10 09:31
vz7_check_a2_zombie-procs.sh
768
B
-rwxr-xr-x
2025-09-10 09:31
vz7_check_nfs_kill.sh
1000
B
-rwxr-xr-x
2025-09-10 09:31
Save
Rename
#!/usr/bin/perl -w # # (c)1999 Ian Cass, Knowledge Matters Ltd. # Read the GNU copyright stuff for all the legalese # # Check NTP time servers plugin. This plugin requires the ntpdate utility to # be installed on the system, however since it's part of the ntp suite, you # should already have it installed. # # # Nothing clever done in this program - its a very simple bare basics hack to # get the job done. # # Things to do... # check @words[9] for time differences greater than +/- x secs & return a # warning. # # (c) 1999 Mark Jewiss, Knowledge Matters Limited # 22-9-1999, 12:45 # # Modified script to accept 2 parameters or set defaults. # Now issues warning or critical alert is time difference is greater than the # time passed. # # These changes have not been tested completely due to the unavailability of a # server with the incorrect time. # # (c) 1999 Bo Kersey, VirCIO - Managed Server Solutions <bo@vircio.com> # 22-10-99, 12:17 # # Modified the script to give usage if no parameters are input. # # Modified the script to check for negative as well as positive # time differences. # # Modified the script to work with ntpdate 3-5.93e Wed Apr 14 20:23:03 EDT 1999 # # Modified the script to work with ntpdate's that return adjust or offset... # # # Script modified 2000 June 01 by William Pietri <william@bianca.com> # # Modified script to handle weird cases: # o NTP server doesn't respond (e.g., has died) # o Server has correct time but isn't suitable synchronization # source. This happens while starting up and if contact # with master has been lost. # # Modified to run under Embedded Perl (sghosh@users.sf.net) # - combined logic some blocks together.. # # Added ntpdate check for stratum 16 desynch peer (James Fidell) Feb 03, 2003 # # ntpdate - offset is in seconds # changed ntpdc to ntpq - jitter/dispersion is in milliseconds # # Patch for for regex for stratum1 refid. require 5.004; use POSIX; use strict; use Getopt::Long; use vars qw($opt_V $opt_h $opt_H $opt_t $opt_w $opt_c $opt_O $opt_j $opt_k $verbose $PROGNAME $def_jitter $ipv4 $ipv6); use FindBin; use lib "$FindBin::Bin"; use utils qw($TIMEOUT %ERRORS &print_revision &support); $PROGNAME="check_ntp"; sub print_help (); sub print_usage (); $ENV{'PATH'}='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin'; $ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; # defaults in sec my $DEFAULT_OFFSET_WARN = 60; # 1 minute my $DEFAULT_OFFSET_CRIT = 120; # 2 minutes # default in millisec my $DEFAULT_JITTER_WARN = 5000; # 5 sec my $DEFAULT_JITTER_CRIT = 10000; # 10 sec Getopt::Long::Configure('bundling'); GetOptions ("V" => \$opt_V, "version" => \$opt_V, "h" => \$opt_h, "help" => \$opt_h, "v" => \$verbose, "verbose" => \$verbose, "4" => \$ipv4, "use-ipv4" => \$ipv4, "6" => \$ipv6, "use-ipv6" => \$ipv6, "w=f" => \$opt_w, "warning=f" => \$opt_w, # offset|adjust warning if above this number "c=f" => \$opt_c, "critical=f" => \$opt_c, # offset|adjust critical if above this number "O" => \$opt_O, "zero-offset" => \$opt_O, # zero-offset bad "j=s" => \$opt_j, "jwarn=i" => \$opt_j, # jitter warning if above this number "k=s" => \$opt_k, "jcrit=i" => \$opt_k, # jitter critical if above this number "t=s" => \$opt_t, "timeout=i" => \$opt_t, "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { print_revision($PROGNAME,'2.4.9'); exit $ERRORS{'OK'}; } if ($opt_h) { print_help(); exit $ERRORS{'OK'}; } # jitter test params specified if (defined $opt_j || defined $opt_k ) { $def_jitter = 1; } $opt_H = shift unless ($opt_H); ## From https://bugzilla.redhat.com/show_bug.cgi?id=1731468 my $host = $opt_H if ($opt_H && ($opt_H =~ m/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/ || # IPv4 $opt_H =~ m/^([0-9a-f]{1,4}:){7}([0-9a-f]{1,4})$/i || # IPv6 without :: $opt_H =~ m/^:(:[0-9a-f]{1,4})+$/i || # IPv6 with leading :: $opt_H =~ m/^([0-9a-f]{1,4}:)+:$/i || # IPv6 with trailing :: $opt_H =~ m/^([0-9a-f]{1,4}:)+(:[0-9a-f]{1,4})+$/i || # IPv6 with middle :: $opt_H =~ m/^[a-z0-9][-a-z0-9]*(\.[a-z0-9][-a-z0-9]*)*$/)); # hostnames unless ($host) { print "No target host specified\n"; print_usage(); exit $ERRORS{'UNKNOWN'}; } my ($timeout, $owarn, $ocrit, $jwarn, $jcrit); $timeout = $TIMEOUT; ($opt_t) && ($opt_t =~ /^([0-9]+)$/) && ($timeout = $1); $owarn = $DEFAULT_OFFSET_WARN; ($opt_w) && ($opt_w =~ /^([0-9.]+)$/) && ($owarn = $1); $ocrit = $DEFAULT_OFFSET_CRIT; ($opt_c) && ($opt_c =~ /^([0-9.]+)$/) && ($ocrit = $1); $jwarn = $DEFAULT_JITTER_WARN; ($opt_j) && ($opt_j =~ /^([0-9]+)$/) && ($jwarn = $1); $jcrit = $DEFAULT_JITTER_CRIT; ($opt_k) && ($opt_k =~ /^([0-9]+)$/) && ($jcrit = $1); if ($ocrit < $owarn ) { print "Critical offset should be larger than warning offset\n"; print_usage(); exit $ERRORS{"UNKNOWN"}; } if ($def_jitter) { if ($opt_k < $opt_j) { print "Critical jitter should be larger than warning jitter\n"; print_usage(); exit $ERRORS{'UNKNOWN'}; } } my $stratum = -1; my $ignoreret = 0; my $answer = undef; my $offset = undef; my $jitter = undef; my $syspeer = undef; my $candidate = 0; my @candidates; my $msg; # first line of output to print if format is invalid my $state = $ERRORS{'UNKNOWN'}; my $ntpdate_error = $ERRORS{'UNKNOWN'}; my $jitter_error = $ERRORS{'UNKNOWN'}; # some systems don't have a proper ntpq (migrated from ntpdc) my $have_ntpq = undef; if ($utils::PATH_TO_NTPQ && -x $utils::PATH_TO_NTPQ ) { $have_ntpq = 1; }else{ $have_ntpq = 0; } # Just in case of problems, let's not hang Nagios $SIG{'ALRM'} = sub { print ("ERROR: No response from ntp server (alarm)\n"); exit $ERRORS{"UNKNOWN"}; }; alarm($timeout); # Determine protocol to be used for ntpdate and ntpq my $ntpdate = $utils::PATH_TO_NTPDATE; my $ntpq = $utils::PATH_TO_NTPQ; if ($ipv4) { $ntpdate .= " -4"; $ntpq .= " -4"; } elsif ($ipv6) { $ntpdate .= " -6"; $ntpq .= " -6"; } # else don't use any flags ### ### ### First, check ntpdate ### ### if (!open (NTPDATE, $ntpdate . " -q $host 2>&1 |")) { print "Could not open $ntpdate: $!\n"; exit $ERRORS{"UNKNOWN"}; } my $out; while (<NTPDATE>) { #print if ($verbose); # noop $msg = $_ unless ($msg); $out .= "$_ "; if (/stratum\s(\d+)/) { $stratum = $1; } if (/(offset|adjust)\s+([-+.\d]+)/i) { $offset = $2; # An offset of 0.000000 with an error is probably bogus. Actually, # it's probably always bogus, but let's be paranoid here. # Has been reported that 0.0000 happens in a production environment # on Solaris 8 so this check should be taken out - SF tracker 1150777 if (defined $opt_O ) { if ($offset == 0) { undef $offset;} } $ntpdate_error = defined ($offset) ? $ERRORS{"OK"} : $ERRORS{"CRITICAL"}; print "ntperr = $ntpdate_error \n" if $verbose; } if (/no server suitable for synchronization found/) { if ($stratum == 16) { $ntpdate_error = $ERRORS{"WARNING"}; $msg = "Desynchronized peer server found"; $ignoreret=1; } else { $ntpdate_error = $ERRORS{"CRITICAL"}; $msg = "No suitable peer server found - "; } } } $out =~ s/\n//g; close (NTPDATE) || die $! ? "$out - Error closing $ntpdate pipe: $!" : "$out - Exit status: $? from $ntpdate\n"; # declare an error if we also get a non-zero return code from ntpdate # unless already set to critical if ( $? && !$ignoreret ) { print "stderr = $? : $! \n" if $verbose; $ntpdate_error = $ntpdate_error == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"UNKNOWN"} ; print "ntperr = $ntpdate_error : $!\n" if $verbose; } ### ### ### Then scan xntpq/ntpq if it exists ### and look in the 11th column for jitter ### # Field 1: Tally Code ( Space, 'x','.','-','+','#','*','o') # Only match for '*' which implies sys.peer # or 'o' which implies pps.peer # If both exist, the last one is picked. # Field 2: address of the remote peer # Field 3: Refid of the clock (0.0.0.0 if unknown, WWWV/PPS/GPS/ACTS/USNO/PCS/... if Stratum1) # Field 4: stratum (0-15) # Field 5: Type of the peer: local (l), unicast (u), multicast (m) # broadcast (b); not sure about multicast/broadcast # Field 6: last packet receive (in seconds) # Field 7: polling interval # Field 8: reachability register (octal) # Field 9: delay # Field 10: offset # Field 11: dispersion/jitter # # According to bug 773588 Some solaris xntpd implementations seemto match on # "#" even though the docs say it exceeds maximum distance. Providing patch # here which will generate a warining. if ($have_ntpq) { if ( open(NTPQ, $ntpq . " -np $host 2>&1 |") ) { while (<NTPQ>) { print $_ if ($verbose); if ( /timed out/ ){ $have_ntpq = 0 ; last ; } # number of candidates on <host> for sys.peer if (/^(\*|\+|\#|o])/) { ++$candidate; push (@candidates, $_); print "Candidate count= $candidate\n" if ($verbose); } # match sys.peer or pps.peer if (/^(\*|o)(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/) { $syspeer = $2; $stratum = $4; $jitter = $11; print "match $_ \n" if $verbose; if ($jitter > $jcrit) { print "Jitter_crit = $11 :$jcrit\n" if ($verbose); $jitter_error = $ERRORS{'CRITICAL'}; } elsif ($jitter > $jwarn ) { print "Jitter_warn = $11 :$jwarn\n" if ($verbose); $jitter_error = $ERRORS{'WARNING'}; } else { $jitter_error = $ERRORS{'OK'}; } } else { print "No match!\n" if $verbose; } } close NTPQ || die $! ? "Error closing $ntpq pipe: $!" : "Exit status: $? from $ntpq\n"; # if we did not match sys.peer or pps.peer but matched # candidates only # generate a warning # based on bug id 773588 unless (defined $syspeer) { if ($#candidates >=0) { foreach my $c (@candidates) { $c =~ /^(#)([-0-9.\s]+)\s+([-0-9A-Za-z_().]+)\s+([-0-9.]+)\s+([lumb-]+)\s+([-0-9m.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)/; $syspeer = $2; $stratum = $4; $jitter = $11; print "candidate match $c \n" if $verbose; if ($jitter > $jcrit) { print "Candidate match - Jitter_crit = $11 :$jcrit\n" if ($verbose); $jitter_error = $ERRORS{'CRITICAL'}; }elsif ($jitter > $jwarn ) { print "Candidate match - Jitter_warn = $11 :$jwarn \n" if ($verbose); $jitter_error = $ERRORS{'WARNING'}; } else { $jitter_error = $ERRORS{'WARNING'}; } } } } } } if ($ntpdate_error != $ERRORS{'OK'}) { $state = $ntpdate_error; if ($ntpdate_error == $ERRORS{'WARNING'} ) { $answer = $msg; } else { $answer = $msg . "Server for ntp probably down"; } if (defined($offset) && abs($offset) > $ocrit) { $state = $ERRORS{'CRITICAL'}; $answer = "Server Error and offset $offset sec > +/- $ocrit sec"; } elsif (defined($offset) && abs($offset) > $owarn) { $answer = "Server error and offset $offset sec > +/- $owarn sec"; } elsif (defined($jitter) && abs($jitter) > $jcrit) { $answer = "Server error and jitter $jitter msec > +/- $jcrit msec"; } elsif (defined($jitter) && abs($jitter) > $jwarn) { $answer = "Server error and jitter $jitter msec > +/- $jwarn msec"; } } elsif ($have_ntpq && $jitter_error != $ERRORS{'OK'}) { $state = $jitter_error; $answer = "Jitter $jitter too high"; if (defined($offset) && abs($offset) > $ocrit) { $state = $ERRORS{'CRITICAL'}; $answer = "Jitter error and offset $offset sec > +/- $ocrit sec"; } elsif (defined($offset) && abs($offset) > $owarn) { $answer = "Jitter error and offset $offset sec > +/- $owarn sec"; } elsif (defined($jitter) && abs($jitter) > $jcrit) { $answer = "Jitter error and jitter $jitter msec > +/- $jcrit msec"; } elsif (defined($jitter) && abs($jitter) > $jwarn) { $answer = "Jitter error and jitter $jitter msec > +/- $jwarn msec"; } } elsif( !$have_ntpq ) { # no errors from ntpdate and no ntpq or ntpq timed out if (abs($offset) > $ocrit) { $state = $ERRORS{'CRITICAL'}; $answer = "Offset $offset sec > +/- $ocrit sec"; } elsif (abs($offset) > $owarn) { $state = $ERRORS{'WARNING'}; $answer = "Offset $offset sec > +/- $owarn sec"; } elsif (( abs($offset) > $owarn) && $def_jitter ) { $state = $ERRORS{'WARNING'}; $answer = "Offset $offset sec > +/- $owarn sec, ntpq timed out"; } elsif ( $def_jitter ) { $state = $ERRORS{'WARNING'}; $answer = "Offset $offset secs, ntpq timed out"; } else{ $state = $ERRORS{'OK'}; $answer = "Offset $offset secs"; } } else { # no errors from ntpdate or ntpq if (abs($offset) > $ocrit) { $state = $ERRORS{'CRITICAL'}; $answer = "Offset $offset sec > +/- $ocrit sec, jitter $jitter msec"; } elsif (abs($jitter) > $jcrit ) { $state = $ERRORS{'CRITICAL'}; $answer = "Jitter $jitter msec> +/- $jcrit msec, offset $offset sec"; } elsif (abs($offset) > $owarn) { $state = $ERRORS{'WARNING'}; $answer = "Offset $offset sec > +/- $owarn sec, jitter $jitter msec"; } elsif (abs($jitter) > $jwarn ) { $state = $ERRORS{'WARNING'}; $answer = "Jitter $jitter msec> +/- $jwarn msec, offset $offset sec"; } else { $state = $ERRORS{'OK'}; $answer = "Offset $offset secs, jitter $jitter msec, peer is stratum $stratum"; } } foreach my $key (keys %ERRORS) { if ($state==$ERRORS{$key}) { $offset =~ s/\+//; print ("NTP $key: $answer|offset=".$offset."s;$owarn;$ocrit;;"); if ($have_ntpq) { print (", jitter=" . $jitter/1000 . ",peer_stratum=$stratum"); } print ("\n"); last; } } exit $state; #### #### subs sub print_usage () { print "Usage: $PROGNAME -H <host> [-46] [-O] [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-v verbose]\n"; } sub print_help () { print_revision($PROGNAME,'2.4.9'); print "Copyright (c) 2003 Bo Kersey/Karl DeBisschop\n"; print "\n"; print_usage(); print " Checks the local timestamp offset versus <host> with ntpdate Checks the jitter/dispersion of clock signal between <host> and its sys.peer with ntpq\n -O (--zero-offset) A zero offset on \"ntpdate\" will generate a CRITICAL.\n -w (--warning) Clock offset in seconds at which a warning message will be generated.\n Defaults to $DEFAULT_OFFSET_WARN. -c (--critical) Clock offset in seconds at which a critical message will be generated.\n Defaults to $DEFAULT_OFFSET_CRIT. -j (--jwarn) Clock jitter in milliseconds at which a warning message will be generated.\n Defaults to $DEFAULT_JITTER_WARN. -k (--jcrit) Clock jitter in milliseconds at which a critical message will be generated.\n Defaults to $DEFAULT_JITTER_CRIT. If jitter/dispersion is specified with -j or -k and ntpq times out, then a warning is returned.\n -4 (--use-ipv4) Use IPv4 connection -6 (--use-ipv6) Use IPv6 connection \n"; support(); }