Passive Service Checks in Nagios 2.0

Brian C. Huffman bhuffman at incyte.com
Tue Aug 16 19:45:31 CEST 2005


All,

I'm trying to setup a passive service check - specifically, I have
syslog-ng / sec combination to monitor system log files and then to
write into the nagios cmd file.  In Nagios 1.2, I didn't need to specify
a check_command (since there isn't one), and even looking at the 2.0
documentation, it doesn't mention a check command:

In Nagios:

      * Configure a service called Port Scans and associate it with the
        host that PortSentry is running on.
      * Set the max_check_attempts option in the service definition to
        1. This will tell Nagios to immediate force the service into a
        hard state when a non-OK state is reported.
      * Either set the active_checks_enabled option to 0 or set the
        check_time option in the service definition to a timeperiod that
        contains no valid time ranges. Doing either of these will
        prevent Nagios from ever actively checking the service. Even
        though the service check will get scheduled, it will never
        actually be checked.

So....why then does nagios -v ./nagios.cfg give me this error:

Error: Service description, host name, or check command is NULL
Error: Could not register service (config file
'/usr/local/nagios2/etc/services.cfg', starting on line 16)

The description and host name do exist, so I can only assume that it
wants a check command...  This doesn't seem to make sense to me for a
passive service.  What's the work around?

Thanks,
Brian

On Fri, 2005-08-12 at 14:26 -0400, chris hammond wrote:
> Ok, with that change it appears to be trying to work but the page now
> comes up like this.
> 
> "ApplicationCode", "operator" => "=", "value" => "NAGIOS"); $filter[] =
> array("key" => "SeverityID", "operator" => "=", "value" => "8");
> $tempEvents = $eventQuery->getEventsByFilter($filter, "ReportDate",
> "DESC", 5); // We don't have any dates we need, all we want is the
> latest 20 if(count($tempEvents)) { foreach($tempEvents as $event) {
> $severityInfo = $eventQuery->getSeverity($event['SeverityID']);
> $tempEventsSeverityNames[] = $severityInfo[0]['Name']; } } $hostQuery =
> new CollageHostQuery($collageDB); $serviceQuery = new
> CollageServiceQuery($collageDB); // Let's first parse any actions and
> update if(count($_SESSION['netView']['hostgroups'])) {
> foreach($_SESSION['netView']['hostgroups'] as &$container) {
> $container->parseAction(); $container->update($collageDB); } }
> $leftHeaderLinks[] = array('url' => $_SERVER['PHP_SELF'], 'text' =>
> 'Manual Reload'); $rightHeaderLinks[] = array('url' =>
> $path_config['doc_root'] . 'prefs.php', 'text' => 'Preferences');
> $rightHeaderLinks[] = array('url' => $path_config['doc_root'] .
> 'index.php?netrefresh=1', 'text' => 'Reload Application');
> print_header("NetView"); ?>
> Statistics
> Number of HostGroups:
> 	Number of Hosts:
> 	Number of Services:
> 
> getHostByDeviceID($tempEvents[$counter]['DeviceID']);
> if(isset($_SESSION['hosts'][$tempHostData['HostName']]))
> $tempServiceData =
> $serviceQuery->getServiceByStatusID($tempEvents[$counter]['ServiceStatusID']);
> if(!isset($_SESSION['hosts'][$tempHostData['HostName']]) ||
> (isset($tempServiceData) &&
> !isset($_SESSION['services'][$tempHostData['HostName']][$tempServiceData['ServiceDescription']])))
> { // $_SESSION['outofSync'] = true; continue; } if($counter % 2) {
> $tdClass= "tableFill03"; } else { $tdClass = "tableFill02"; } ?>
> Last 5 Critical Events
> There Are No Critical Events To Display
> Report Date 	Host 	Service 	Severity 	Application Name
> 	Message
> 				  	
> 
> 
> render(); } ?>
> Host Groups
>  
> 
> >>>Taylor Dondich <tdondich at gmail.com> 08/12/05 2:18 pm >>> 
> I've never seen the AddHandler php5-script .php directive when
> configuring php. 
>  
> I use: 
>  
> AddType application/x-httpd-php .php 
>  
> On 8/12/05, chris hammond <chris at tac.esi.net> wrote: 
> >I believe that is set correctly.  Here is my php.conf; 
> > 
> ># 
> ># PHP is an HTML-embedded scripting language which attempts to make it 
> ># easy for developers to write dynamically generated webpages. 
> ># 
> > 
> >LoadModule php5_module modules/libphp5.so 
> > 
> ># 
> ># Cause the PHP interpreter to handle files with a .php extension. 
> ># 
> >AddHandler php5-script .php 
> >AddType text/html .php 
> > 
> ># 
> ># Add index.php to the list of files that will be served as directory 
> ># indexes. 
> ># 
> >DirectoryIndex index.php 
> > 
> ># 
> ># Uncomment the following line to allow PHP to pretty-print .phps 
> ># files as PHP source code: 
> ># 
> >#AddType application/x-httpd-php-source .phps 
> > 
> > 
> > 
> >>>>John Mark Walker <jmwalker at itgroundwork.com> 08/12/05 1:50 pm >>> 
> >On Friday 12 August 2005 10:36 am, chris hammond wrote: 
> >>I am trying to setup a sever with foundation and sv but when I try to 
> >>bring up sv, all I see is the php code.  I have checked everything but
> 
> >>can't seem find out why it wont show properly.  php5_module is loading
> 
> >>when apache starts and I have restarted apache after changes.  The 
> >>only error showing up in error_log is that there is no favicon.ico 
> >>in /var/www/html.  Any ideas where else I should look? 
> >> 
> > 
> >The first thing I would check is to make sure that you have PHP enabled
> 
> >for the right file type. Apache checks the file extension to determine 
> >how to parse it. I've made the mistake all too often of having PHP code
> 
> >inside a file with a .html extension without defining PHP for that 
> >extension. Are you running Apache 2.x or 1.3? Each has a different way 
> >of defining interpreters for file extensions. 
> > 
> >-JM 
> > 
> > 
> >------------------------------------------------------- 
> >SF.Net email is Sponsored by the Better Software Conference & EXPO 
> >September 19-22, 2005 * San Francisco, CA * Development Lifecycle
> Practices 
> >Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
> QA 
> >Security * Process Improvement & Measurement *
> http://www.sqe.com/bsce5sf 
> > 
> >Nagios-users mailing list 
> >Nagios-users at lists.sourceforge.net 
> >https://lists.sourceforge.net/lists/listinfo/nagios-users 
> >::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue. 
> >::: Messages without supporting info will risk being sent to /dev/null 
> > 
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list