From: Michael R. <re...@eu...> - 2004-03-10 18:59:40
|
Hi Javier, > Michael, my real full name is Javier Garcia (Stolz is my nick). Thanks, fixed. What does "Stolz" mean to you? I'm asking because "Stolz" is the german word for "pride" :-) > Here is an "improvised" TO DO list : > -add a function to fetch data (not only the number of rows) from the database > -use persistent connections (connect on init and disconnect on exit) to improve CPU usage > -add some kind of connection trackin > -set default server, user , pass and database in the Variables > if mySQLquery() is called with: > 5 args, do it kike the old way > 2 args, use them like database and query, use default server, user and pass > 1 arg, use it like query, use default server, user , pass and database > -add an argument to mySQLstatus funtion. > The argument will indicate what to return:Uptime, Threads, Questions,Slow queries, Flush tables,... > If uptime, return it Like: Days,hours,minutes Fine! I'm expecting results until tomorrow evening :-) > How can I get the variables from the config file, is there any function? Of course there are. Take a look into plugin_imon.c Basically, there are two function: For Strings, use char *cfg_get (section, key, default) section would be "MySQL" (it's the "Block" from the config file key is the requested parameter name default is the default value which will be returned if the key does not exist in the config file For Numbers, use cfg_number(section, key, default,min,max,int *value) acts like cfg_get(), but does some range checking with min and max bye, Michael -- Michael Reinelt Tel: +43 676 3079941 Geisslergasse 4 Fax: +43 316 692343 A-8045 Graz, Austria e-mail: re...@eu... |