@@ -0,0 +1,289 @@
+68,87d67
+< int strIndexOf(char *string1, char *string2);
+< char *strSubstring(char *string1, char *string2, int StartingPos, int EndPos);
+< char *GetThreadsPerfdata(char *stringtoparse);
+< char *GetQuestionsPerfdata(char *stringtoparse);
+< char *GetSQPerfdata(char *stringtoparse);
+< char *GetOpensPerfdata(char *stringtoparse);
+< char *GetFTPerfdata(char *stringtoparse);
+< char *GetOTPerfdata(char *stringtoparse);
+< char *GetQPSAPerfdata(char *stringtoparse);
+<
+< struct mysql_statistics
+< {
+< char *ThreadsPerfdata;
+< char *QuestionsPerfdata;
+< char *SQPerfdata;
+< char *OpensPerfdata;
+< char *FTPerfdata;
+< char *OTPerfdata;
+< char *QPSAPerfdata;
+< };
+102,105d81
+<
+< /* variables needed to parse */
+< char *StringToParse;
+< struct mysql_statistics Stats;
+138,154d113
+< /* parse the server stats */
+< strcpy(StringToParse, result);
+<
+< Stats.ThreadsPerfdata = GetThreadsPerfdata(StringToParse);
+< strcpy(StringToParse, result);
+< Stats.QuestionsPerfdata = GetQuestionsPerfdata(StringToParse);
+< strcpy(StringToParse, result);
+< Stats.SQPerfdata = GetSQPerfdata(StringToParse);
+< strcpy(StringToParse, result);
+< Stats.OpensPerfdata = GetOpensPerfdata(StringToParse);
+< strcpy(StringToParse, result);
+< Stats.FTPerfdata = GetFTPerfdata(StringToParse);
+< strcpy(StringToParse, result);
+< Stats.OTPerfdata = GetOTPerfdata(StringToParse);
+< strcpy(StringToParse, result);
+< Stats.QPSAPerfdata = GetQPSAPerfdata(StringToParse);
+<
+270c229
+< printf ("%s %s | %s %s %s %s %s %s %s\n", result, slaveresult, Stats.ThreadsPerfdata, Stats.SQPerfdata, Stats.OpensPerfdata, Stats.FTPerfdata, Stats.OTPerfdata, Stats.QPSAPerfdata);
+---
+> printf ("%s %s\n", result, slaveresult);
+272c231
+< printf ("%s | %s %s %s %s %s %s %s\n", result, Stats.ThreadsPerfdata, Stats.QuestionsPerfdata, Stats.SQPerfdata, Stats.OpensPerfdata, Stats.FTPerfdata, Stats.OTPerfdata, Stats.QPSAPerfdata);
+---
+> printf ("%s\n", result);
+278,512d236
+< char
+< *GetQPSAPerfdata(char *stringtoparse)
+< {
+< int Start = 0;
+< int End = 0;
+< char *qpsa;
+< char *output;
+< Start = strIndexOf("Queries per second avg\0", stringtoparse);
+< End = strlen(stringtoparse);
+<
+< qpsa = strSubstring(qpsa, stringtoparse, Start, End);
+< qpsa = strSubstring(qpsa, qpsa, strIndexOf(" \0", qpsa) + 1, strlen(qpsa));
+< qpsa = strSubstring(qpsa, qpsa, strIndexOf(" \0", qpsa) + 1, strlen(qpsa));
+< qpsa = strSubstring(qpsa, qpsa, strIndexOf(" \0", qpsa) + 1, strlen(qpsa));
+< qpsa = strSubstring(qpsa, qpsa, strIndexOf(" \0", qpsa) + 1, strlen(qpsa));
+< printf("%s", qpsa);
+< asprintf(&output, "%s", fperfdata("queries_per_second_avg", atof(qpsa), "",
+< FALSE, 0,
+< FALSE, 0,
+< TRUE, 0,
+< FALSE, 0));
+<
+< return output;
+< }
+<
+< char
+< *GetOTPerfdata(char *stringtoparse)
+< {
+< int Start = 0;
+< int End = 0;
+< char *ot;
+< char *output;
+< Start = strIndexOf("Open tables\0", stringtoparse);
+< End = strIndexOf("Queries per second avg\0", stringtoparse);
+<
+< ot = strSubstring(ot, stringtoparse, Start, End - 2);
+< ot = strSubstring(ot, ot, strIndexOf(" \0", ot) + 1, strlen(ot));
+< ot = strSubstring(ot, ot, strIndexOf(" \0", ot) + 1, strlen(ot));
+< asprintf(&output, "%s", perfdata("open_tables", atoi(ot), "",
+< FALSE, 0,
+< FALSE, 0,
+< TRUE, 0,
+< FALSE, 0));
+<
+< return output;
+< }
+<
+< char
+< *GetFTPerfdata(char *stringtoparse)
+< {
+< int Start = 0;
+< int End = 0;
+< char *ft;
+< char *output;
+< Start = strIndexOf("Flush tables\0", stringtoparse);
+< End = strIndexOf("Open tables\0", stringtoparse);
+<
+< ft = strSubstring(ft, stringtoparse, Start, End - 2);
+< ft = strSubstring(ft, ft, strIndexOf(" \0", ft) + 1, strlen(ft));
+< ft = strSubstring(ft, ft, strIndexOf(" \0", ft) + 1, strlen(ft));
+< asprintf(&output, "%s", perfdata("flush_tables", atoi(ft), "",
+< FALSE, 0,
+< FALSE, 0,
+< TRUE, 0,
+< FALSE, 0));
+<
+< return output;
+< }
+<
+< char
+< *GetOpensPerfdata(char *stringtoparse)
+< {
+< int Start = 0;
+< int End = 0;
+< char *opens;
+< char *output;
+< Start = strIndexOf("Opens\0", stringtoparse);
+< End = strIndexOf("Flush tables\0", stringtoparse);
+<
+< opens = strSubstring(opens, stringtoparse, Start, End - 2);
+< opens = strSubstring(opens, opens, strIndexOf(" \0", opens) + 1, strlen(opens));
+< asprintf(&output, "%s", perfdata("opens", atoi(opens), "",
+< FALSE, 0,
+< FALSE, 0,
+< TRUE, 0,
+< FALSE, 0));
+<
+< return output;
+< }
+<
+< char
+< *GetSQPerfdata(char *stringtoparse)
+< {
+< int Start = 0;
+< int End = 0;
+< char *slowqueries;
+< char *output;
+< Start = strIndexOf("Slow queries\0", stringtoparse);
+< End = strIndexOf("Opens\0", stringtoparse);
+<
+< slowqueries = strSubstring(slowqueries, stringtoparse, Start, End - 2);
+< slowqueries = strSubstring(slowqueries, slowqueries, strIndexOf(" \0", slowqueries) + 1, strlen(slowqueries));
+< slowqueries = strSubstring(slowqueries, slowqueries, strIndexOf(" \0", slowqueries) + 1, strlen(slowqueries));
+< asprintf(&output, "%s", perfdata("slow_queries", atoi(slowqueries), "",
+< FALSE, 0,
+< FALSE, 0,
+< TRUE, 0,
+< FALSE, 0));
+<
+< return output;
+< }
+<
+< char
+< *GetQuestionsPerfdata(char *stringtoparse)
+< {
+< int Start = 0;
+< int End = 0;
+< char *questions;
+< char *output;
+< Start = strIndexOf("Questions\0", stringtoparse);
+< End = strIndexOf("Slow queries\0", stringtoparse);
+<
+< questions = strSubstring(questions, stringtoparse, Start, End - 2);
+< questions = strSubstring(questions, questions, strIndexOf(" \0", questions) + 1, strlen(questions));
+< asprintf(&output, "%s", perfdata("questions", atoi(questions), "",
+< FALSE, 0,
+< FALSE, 0,
+< TRUE, 0,
+< FALSE, 0));
+<
+< return output;
+< }
+<
+< char
+< *GetThreadsPerfdata(char *stringtoparse)
+< {
+< int Start = 0;
+< int End = 0;
+< char *threads;
+< char *output;
+<
+< Start = strIndexOf("Threads\0", stringtoparse);
+< End = strIndexOf("Questions\0", stringtoparse);
+<
+< threads = strSubstring(threads, stringtoparse, Start, End - 2);
+< threads = strSubstring(threads, threads, strIndexOf(" \0", threads) + 1, strlen(threads));
|