ASNMTAP

 view release on metacpan or  search on metacpan

plugins/snmptt/create_NCPL_weblogic_configuration_for_SNMP.pl  view on Meta::CPAN

          my $timeperiod = ( $environment =~ /PROD/ ? '' : $timeperiod_acc );

          my $sqlCOUNT = "SELECT count(host_name) FROM nagios_hosts WHERE host_name = '$host_name'";
          print "    $sqlCOUNT\n" if ( $debug );
          $sthNCPL = $dbhNCPL->prepare($sqlCOUNT) or $rv = _ErrorTrapDBI ( 'dbh->prepare '. $sqlCOUNT, "$DBI::err ($DBI::errstr)" );
          $sthNCPL->execute or $rv = _ErrorTrapDBI ( 'sth->execute '. $sqlCOUNT, "$DBI::err ($DBI::errstr)" );
          my $existingHost = $sthNCPL->fetchrow_array();
          $sthNCPL->finish() or $rv = _ErrorTrapDBI ( \$objectPlugins, 'Cannot sth->finish: '. $sqlCOUNT );

          unless ( $existingHost ) {
            my $sqlINSERT = "INSERT INTO nagios_hosts SET server_name='$server_name', category='$category', environments='$environment', nslookup=0, synchronize=0, virtual=1, host_name='$host_name', alias='$domainname - $environment', `use`='$use_hos...
            print "    $sqlINSERT\n" if ( $debug );
            $dbhNCPL->do( $sqlINSERT ) or $rv = _ErrorTrapDBI ( \$objectPlugins, 'Cannot dbh->do: '. $sqlINSERT ) if $rv;
            $objectPlugins->pluginValues ( { stateValue => $ERRORS{CRITICAL}, error => "'$host_name' doesn't EXIST" }, $TYPE{APPEND} ) unless $rv;
          }

          $nagiosCommands .= '['. time() .'] PROCESS_SERVICE_CHECK_RESULT;' .$host_name. ';' .$service_description. ';0;Manual reset' ."\n";

          my $sqlINSERT = "INSERT INTO nagios_services SET server_name = '$server_name', category = '$category', host_name = '$host_name', service_description = '$service_description', `use` = '$use_services', contact_groups = '$contact_groups', chec...
          print "    $sqlINSERT\n" if ( $debug );
          $dbhNCPL->do( $sqlINSERT ) or $rv = _ErrorTrapDBI ( \$objectPlugins, 'Cannot dbh->do: '. $sqlINSERT ) if $rv;



( run in 0.284 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )