title: how can execute nagios commands from command line in linux
body: <p>I am using nagios o centos server and i only want to monitor the localhost only.</p>
  
  <p>I have defined my service like this</p>
  
  <pre><code>define service{
   host_name  localhost
   service_description Site1Service
   check_command  check_http-site1
   use   generic-service
   notification_interval 1440
  }
  </code></pre>
  
  <p>and</p>
  
  <p>command like this in commands.cfg</p>
  
  <pre><code>define command{
   command_name check_http-site1
   command_line /usr/lib/nagios/plugins/check_http -H site1.dreaddomain.com
  }
  </code></pre>
  
  <p>I am getting critical error in there. so i want to check from command line if that service is running or not</p>