Nagios Exchange Nagios Exchange
  • Home
  • Directory
  • Library
  • Support
  • 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

Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More

  • Home
  • Directory
  • Library
  • Support
  • About
Plugins4405Themes and Skins13Add-ons757Graphics 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
Windows NRPE Updated: Check Free Disk Space (check_disk)
0.0 (0)
8.8K
RSS Feed
Newest Listings Updated Listings
Top Contributors
Yoann LAMY (7)deskwork_itunes142 (4)Julien DESMAREST (3)Davide Lemma (3)Chad Columbus (3)
See More
Newest Contributors
signalgrid (1)Sanna Glue (2)fisherrs (1)smolinux (1)juanfertor (1)
See More

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

Privacy PolicyTerms of UseTrademarks
Home > Olivier Ragain
OR

Olivier Ragain

@oragain

User Stats

Member Since: December 10, 2014

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.6K
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.6K
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-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home Browse Submit Profile