diff options
author | M. Sean Finney <seanius@users.sourceforge.net> | 2005-06-26 16:27:05 +0000 |
---|---|---|
committer | M. Sean Finney <seanius@users.sourceforge.net> | 2005-06-26 16:27:05 +0000 |
commit | 69e1b0fe391b611fed0dd57422dbff76d5ea9546 (patch) | |
tree | 59b0ef368deb4e4574a869f1c75df8a9cefa0c5e /contrib/check_mysql.c | |
parent | 9bab24cf9573700751ba5f43fe7966f5ca338e47 (diff) | |
download | monitoring-plugins-69e1b0fe391b611fed0dd57422dbff76d5ea9546.tar.gz |
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
Diffstat (limited to 'contrib/check_mysql.c')
-rw-r--r-- | contrib/check_mysql.c | 75 |
1 files changed, 0 insertions, 75 deletions
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 <host> [user] [passwd] - * <host> 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 <host> [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; -} - - |