From 69e1b0fe391b611fed0dd57422dbff76d5ea9546 Mon Sep 17 00:00:00 2001 From: "M. Sean Finney" Date: Sun, 26 Jun 2005 16:27:05 +0000 Subject: spring cleaning of contrib directory from andreas git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1192 f882894a-f735-0410-b71e-b25c423dba1c --- contrib/check_mysql.c | 75 --------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 contrib/check_mysql.c (limited to 'contrib/check_mysql.c') diff --git a/contrib/check_mysql.c b/contrib/check_mysql.c deleted file mode 100644 index 56725dc4..00000000 --- a/contrib/check_mysql.c +++ /dev/null @@ -1,75 +0,0 @@ -/***************************************************************** - * - * Program: check_mysql.c - * License: GPL - * - * Written by Tim Weippert - * (based on plugins by Ethan Galstad and MySQL example code) - * - * Command line: check_mysql [user] [passwd] - * can be the FQDN or the IP-Adress - * [user] and [passwd] are optional - * - * Description: - * - * This plugin attempts to connect to an MySQL Server - * with the optional specified parameters user and passwd. - * Normaly the host and a user HAVE to assigned. - * - * The plugin returns - * STATE_OK and the Version Number of the Server when all is fine - * STATE_CRITICAL if the Connection can't be esablished - * STATE_WARNING if the connection was established but the - * program can't get the Versoin Number - * STATE_UNKNOWN if to many parameters are given - * - * Copyright (c) 1999 by Tim Weippert - * - * Changes: - * 16.12.1999: Changed the return codes from numbers to statements - * - *******************************************************************/ - -#include "config.h" -#include "common.h" -#include "mysql.h" - -MYSQL mysql; - -int main(int argc, char **argv) -{ - uint i = 0; - char *host; - char *user; - char *passwd; - - char *status; - char *version; - - if ( argc > 4 ) { - printf("Too many Arguments supplied - %i .\n", argc); - printf("Usage: %s [user] [passwd]\n", argv[0]); - return STATE_UNKNOWN; - } - - (host = argv[1]) || (host = NULL); - (user = argv[2]) || (user = NULL); - (passwd = argv[3]) || (passwd = NULL); - - if (!(mysql_connect(&mysql,host,user,passwd))) { - printf("Can't connect to Mysql on Host: %s\n", host); - return STATE_CRITICAL; - } - - if ( !(version = mysql_get_server_info(&mysql)) ) { - printf("Connect OK, but can't get Serverinfo ... something wrong !\n"); - return STATE_WARNING; - } - - printf("Mysql ok - Running Version: %s\n", version); - - mysql_close(&mysql); - return STATE_OK; -} - - -- cgit v1.2.3