Nagios Exchange
  • Home
  • Directory
  • About

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up
Plugins4387Themes and Skins11Add-ons732Documentation283Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
Configuration Wizards Esensors Websensor Nagios XI Monitoring Wizard
3.5 (2)
107K
RSS Feed
Newest Listings Updated Listings
Top Contributors
LAMY (7)Julien DESMAREST (6)deskwork_itunes142 (4)Davide Lemma (4)Joerg Hoerter (3)
See More
Newest Contributors
Guillaume8723 (1)Salvo (1)SOHA-IT (1)Tsvetomir Tsvetanov (1)Igor Ru (1)
See More
Home > Olivier Ragain
OR

Olivier Ragain

@oragain

User Stats

Favorites0

Views0

Projects2

check_dell_md3200
Dell
check_dell_md3200
Check health and perf data of MD3200 and MD3000. Requires SMcli be installed on the system. And centreon/nagios have rights to execute it. 2015/03/27: Added…
3.5 (2)
13.4K
0
Olivier Ragain
check_mssql_sp
SQLServer
check_mssql_sp
Allow you to run a stored procedure on an MSSQL server. Loosely based on the check_mssql plugin. Loops and output the data of all returned…
0.0 (0)
15.2K
0
Olivier Ragain
check_mssql

getting value of query

You can actually easily modify the script in order to retrieve values from the query. I modified mine to retrieve only one value: in process_results, i changed $perfdata=.... to $perfdata = "value={$query_duration};0;"; There is no need for me to actually show static lines for warning and critical. i initially did the change for query, but due to the complexity of the query, just better to go through a stored proc to dodge nagios / centreon cleanup string functions. before the call to process_results i did the following changes that will allow you to retrieve a value for a procedure: //Custom modification by ######### if ($querytype == "stored procedure") { $stmt = mssql_init($oldstoredproc); $query_data = mssql_execute($stmt); $query_result="no result returned"; if (mssql_num_rows($query_data) > 0 ) { $row = mssql_fetch_row($query_data); $query_result = $row[0]; // cheating on process_results $query_duration = $query_result; $output_msg = "Value=$query_result."; } mssql_free_statement($stmt); $exit_code = 0; } // end of custom and at the beginning of the file, I changed to the following because mssql_execute does not need the exec part: // Add "exec" to the beginning of the stored proc if it doesnt exist. if (isset($storedproc)) { $oldstoredproc = $storedproc; if (substr($storedproc, 0, 5) != "exec ") { $storedproc = "exec $storedproc"; } }

Reviewed 11 years ago

No Favorites Found

Copyright © 2009-2025 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks