in the command definition you have now:
-p 2022 $ARG1$
using 2022 as an example.
problem is theorically you either define a fixed port:
check_ssh_2022 ...] -p 2022 ...]
or you use a parameter:
check_ssh_port ...] -p $ARG1$ ...]
i left out ...] all which is irrelevant now.
in the first case it will use port 2022 every time
in the second case you will have to use
in the service deiniiton
! indicates an argument being the port number $ARG1$ it has to be the first argument used.
Hope this helps