Go to your plugin directory - in my example it is
/usr/lib64/nagios/plugins/
Type you plugin name - in my example it is
check_tcp
now run the full command - (plugin name) -H (hostname) -p (port number)
/usr/lib64/nagios/plugins/check_tcp -H myservername -p 8080
output
TCP OK - 0.004 second response time on port 8080|time=0.004146s;;;0.000000;10.000000
However in this example port number is optional
another example -
in your config file which is look something like below (myserver.cfg) and you want to run check_cpu from command line
define service{
use generic-service
host_name myserver
servicegroups windows
service_description CPU
contact_groups sysadmin_email_only
notification_options w,c,r
check_command check_nrpe!check_cpu
}
to check instantly (without GUI green or red)
Try this - (plugin full path) - H (servername) -c (checkname)
/usr/lib64/nagios/plugins/check_nrpe -H spc7atc01 -c check_cpu
output -
OK CPU Load ok.|'5'=4;80;90; '10'=3;80;90; '15'=3;80;90;
Thats it