diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | create/mysql/schema.sql | 2 | ||||
-rw-r--r-- | doc/manual.lyx | 151 | ||||
-rw-r--r-- | frontends/php/alerts.php | 37 | ||||
-rw-r--r-- | frontends/php/hosts.php | 2 | ||||
-rw-r--r-- | frontends/php/include/config.inc.php | 94 | ||||
-rw-r--r-- | frontends/php/latestalarms.php | 28 | ||||
-rw-r--r-- | frontends/php/queue.php | 3 | ||||
-rw-r--r-- | frontends/php/users.php | 2 | ||||
-rw-r--r-- | include/functions.c | 2 | ||||
-rw-r--r-- | src/zabbix_agent/sysinfo.c | 2 | ||||
-rw-r--r-- | src/zabbix_sucker/zabbix_sucker.c | 2 |
12 files changed, 259 insertions, 67 deletions
@@ -19,6 +19,7 @@ snmpget -On localhost public enterprises.ucdavis.memory.memTotalSwap.0] Changes for 1.0beta4: + - added Next100 and Prev100 for alerts and alarms (Alexei) - check permissions for Availability report (Alexei) - added parameter SenderFrequency to zabbix_suckerd configuration file (Alexei) diff --git a/create/mysql/schema.sql b/create/mysql/schema.sql index d518a72f..f7355c80 100644 --- a/create/mysql/schema.sql +++ b/create/mysql/schema.sql @@ -132,7 +132,7 @@ CREATE TABLE alerts ( PRIMARY KEY (alertid), INDEX (actionid), KEY clock (clock), - KEY status_retries (sent, retries) + KEY status_retries (status, retries) ); -- diff --git a/doc/manual.lyx b/doc/manual.lyx index f224929d..1d3c7d6a 100644 --- a/doc/manual.lyx +++ b/doc/manual.lyx @@ -24,13 +24,13 @@ \layout Title \added_space_top vfill -Zabbix Reference Manual for version 1.0 (draft v1.22) +Zabbix Reference Manual for version 1.0 (draft v1.23) \layout Author ALEXEI VLADISHEV \layout Date -23 June 2002 +27 June 2002 \layout Abstract The document is Reference Manual for Zabbix version 1.0. @@ -175,7 +175,7 @@ script \layout Standard -Commands +Shell commands \end_inset </cell> </row> @@ -667,7 +667,7 @@ A What resources specific IT service depends on? \layout Standard -Example: WEB portan depends on the following recources: +Example: WEB portal may depend on the following recources: \layout Enumerate processor load on server @@ -6748,7 +6748,7 @@ FreeBSD localhost 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Tue Sep 18 11:57:08 SNMP parameters \layout Standard -When defining SNMP parameter, the following field must be filled: +Example: \layout Standard Community: public @@ -6758,6 +6758,24 @@ Oid: 1.2.3.45.6.7.8.0 \layout Standard Key: <Unique string to be used as reference to triggers> +\newline + +\newline +Note that OID can be given in either numeric or in string form. + However, in some cases, string OID must be converted to numeric representation. + Untility +\emph on +snmpget +\emph default + may be used for this purpose: +\newline + +\layout Standard + + +\family typewriter +\emph on +snmpget -On localhost public enterprises.ucdavis.memory.memTotalSwap.0 \layout Standard \layout Subsection @@ -9737,6 +9755,129 @@ X \layout Section +Monitoring of specific applications +\layout Subsection + +MySQL +\layout Standard + +Configuration file +\emph on +misc/conf/zabbix_agentd.conf +\emph default + contains list of user defined parameters that can be used for monitoring + of MySQL. +\newline + +\layout Standard + + +\family typewriter +\emph on +### Set of parameter for monitoring MySQL server (v3.23.42 and later) +\layout Standard + + +\family typewriter +\emph on +### Change -u<username> and add -p<password> if required +\layout Standard + + +\family typewriter +\emph on +\SpecialChar ~ + +\layout Standard + + +\family typewriter +\emph on +#UserParameter=mysql[ping],mysqladmin -uroot ping|grep alive|wc -l +\layout Standard + + +\family typewriter +\emph on +#UserParameter=mysql[uptime],mysqladmin -uroot status|cut -f2 -d":"|cut + -f1 -d"T" +\layout Standard + + +\family typewriter +\emph on +#UserParameter=mysql[threads],mysqladmin -uroot status|cut -f3 -d":"|cut + -f1 -d"Q" +\layout Standard + + +\family typewriter +\emph on +#UserParameter=mysql[questions],mysqladmin -uroot status|cut -f4 -d":"|cut + -f1 -d"S" +\layout Standard + + +\family typewriter +\emph on +#UserParameter=mysql[slowqueries],mysqladmin -uroot status|cut -f5 -d":"|cut + -f1 -d"O" +\layout Standard + + +\family typewriter +\emph on +#UserParameter=mysql[qps],mysqladmin -uroot status|cut -f9 -d":" +\layout Standard + + +\family typewriter +\emph on +#UserParameter=version[mysql],mysql -V +\layout Description + +mysql[ping] +\latex no_latex +Check +\latex default +, if MySQL is alive +\layout Standard + + +\latex no_latex +Result: 0 - +\latex default +not started +\layout Standard + + +\latex no_latex +1 - +\latex default +alive +\layout Description + +mysql[uptime] Number of seconds MySQL is running +\layout Description + +mysql[threads] Number of MySQL threads +\layout Description + +mysql[questions] Number of processed queries +\layout Description + +mysql[slowqueries] Number of slow queries +\layout Description + +mysql[qps] Queries per second +\layout Description + +mysql[version] Version of MySQL +\layout Standard + +Example: mysql Ver 11.16 Distrib 3.23.49, for pc-linux-gnu (i686) +\layout Section + Getting Maximum Performace From Zabbix \layout Subsection diff --git a/frontends/php/alerts.php b/frontends/php/alerts.php index aea93872..9aa1891d 100644 --- a/frontends/php/alerts.php +++ b/frontends/php/alerts.php @@ -13,18 +13,22 @@ ?> <? - if(isset($limit)&&($limit==200)) - { - echo "[<A HREF=\"alerts.php?limit=50\">"; - echo "Show last 50</A>]"; - $limit=" limit 50"; - } - else - { - echo "[<A HREF=\"alerts.php?limit=200\">"; - echo "Show last 200</A>]"; - $limit=" limit 200"; - } + if(isset($start)&&($start<=0)) + { + unset($start); + } + if(isset($start)) + { + echo "[<A HREF=\"alerts.php?start=".($start-100)."\">"; + echo "Show previous 100</A>] "; + echo "[<A HREF=\"alerts.php?start=".($start+100)."\">"; + echo "Show next 100</A>]"; + } + else + { + echo "[<A HREF=\"alerts.php?start=100\">"; + echo "Show next 100</A>]"; + } show_table_header_end(); echo "<br>"; @@ -35,7 +39,14 @@ <FONT COLOR="#000000"> <? - $sql="select a.alertid,a.clock,a.type,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries from alerts a,actions ac where a.actionid=ac.actionid order by a.clock desc $limit"; + if(!isset($start)) + { + $sql="select a.alertid,a.clock,a.type,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries from alerts a,actions ac where a.actionid=ac.actionid order by a.clock desc limit 100"; + } + else + { + $sql="select a.alertid,a.clock,a.type,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries from alerts a,actions ac where a.actionid=ac.actionid order by a.clock desc limit ".($start+100); + } $result=DBselect($sql); echo "<CENTER>"; diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index c2373e3c..d7c667f4 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -44,11 +44,9 @@ <? show_table_header("CONFIGURATION OF HOSTS"); - echo "<br>"; ?> <? - show_table_header("HOSTS"); echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR>"; echo "<TD WIDTH=\"3%\" NOSAVE><B>Id</B></TD>"; diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 1809db4b..5c1550d6 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -2330,6 +2330,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } echo("<hr>"); echo "<center>"; + if($diff==0) { echo "<IMG SRC=\"chart.php?itemid=$itemid&period=$period&from=$from\">"; @@ -2343,6 +2344,69 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; echo "<center>"; + echo "Period: "; + // Start of --- + + if ($period>12*3600) + { + $tmp=$period-12*3600; + if($diff==0) + { + echo("[<A HREF=\"history.php?action=showhistory&itemid=$itemid&from=$from&period=$tmp\">"); + } + else + { + echo("[<A HREF=\"history.php?action=showhistory2&itemid=$itemid&from=$from&period=$tmp\">"); + } + echo("-12h</A>] "); + } + else + { + echo("[-12h]"); + } + + if ($period>3600) + { + $tmp=$period-3600; + if($diff==0) + { + echo("[<A HREF=\"history.php?action=showhistory&itemid=$itemid&from=$from&period=$tmp\">"); + } + else + { + echo("[<A HREF=\"history.php?action=showhistory2&itemid=$itemid&from=$from&period=$tmp\">"); + } + echo("-1h</A>] "); + } + else + { + echo("[-1h]"); + } + + $tmp=$period+3600; + if($diff==0) + { + echo("[<A HREF=\"history.php?action=showhistory&itemid=$itemid&from=$from&period=$tmp\">"); + } + else + { + echo("[<A HREF=\"history.php?action=showhistory2&itemid=$itemid&from=$from&period=$tmp\">"); + } + echo("+1h</A>] "); + + $tmp=$period+12*3600; + if($diff==0) + { + echo("[<A HREF=\"history.php?action=showhistory&itemid=$itemid&from=$from&period=$tmp\">"); + } + else + { + echo("[<A HREF=\"history.php?action=showhistory2&itemid=$itemid&from=$from&period=$tmp\">"); + } + echo("+12h</A>] "); + + echo "<br>Start time:"; + // Start of <<< WEEK >>> $tmp=$from+12*14; if($diff==0) @@ -2367,7 +2431,6 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } echo("12h back</A>] "); // End of <<< 12h >>> - // HOUR BACK $tmp=$from+1; if($diff==0) @@ -2380,35 +2443,6 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } echo("1h back</A>] "); - // Start of --- - $tmp=$period+3600; - if($diff==0) - { - echo("[<A HREF=\"history.php?action=showhistory&itemid=$itemid&from=$from&period=$tmp\">"); - } - else - { - echo("[<A HREF=\"history.php?action=showhistory2&itemid=$itemid&from=$from&period=$tmp\">"); - } - echo("+1h</A>] "); - - if ($period>3600) - { - $tmp=$period-3600; - if($diff==0) - { - echo("[<A HREF=\"history.php?action=showhistory&itemid=$itemid&from=$from&period=$tmp\">"); - } - else - { - echo("[<A HREF=\"history.php?action=showhistory2&itemid=$itemid&from=$from&period=$tmp\">"); - } - echo("-1h</A>] "); - } - else - { - echo("[-1h]"); - } // End of ------ if ($from>0) // HOUR FORWARD diff --git a/frontends/php/latestalarms.php b/frontends/php/latestalarms.php index 8487bfb9..210fcb02 100644 --- a/frontends/php/latestalarms.php +++ b/frontends/php/latestalarms.php @@ -14,15 +14,21 @@ ?> <? - if(isset($limit)) + if(isset($start)&&($start<=0)) { - echo "[<A HREF=\"latestalarms.php\">"; - echo "Show last 50</A>]"; + unset($start); + } + if(isset($start)) + { + echo "[<A HREF=\"latestalarms.php?start=".($start-100)."\">"; + echo "Show previous 100</A>] "; + echo "[<A HREF=\"latestalarms.php?start=".($start+100)."\">"; + echo "Show next 100</A>]"; } else { - echo "[<A HREF=\"latestalarms.php?limit=200\">"; - echo "Show last 200</A>]"; + echo "[<A HREF=\"latestalarms.php?start=100\">"; + echo "Show next 100</A>]"; } show_table_header_end(); @@ -33,13 +39,13 @@ <FONT COLOR="#000000"> <? - if(isset($limit)) + if(!isset($start)) { - $sql="select t.description,a.clock,a.value,t.triggerid from alarms a,triggers t where t.triggerid=a.triggerid order by clock desc limit $limit"; + $sql="select t.description,a.clock,a.value,t.triggerid from alarms a,triggers t where t.triggerid=a.triggerid order by clock desc limit 100"; } else { - $sql="select t.description,a.clock,a.value,t.triggerid from alarms a,triggers t where t.triggerid=a.triggerid order by clock desc limit 50"; + $sql="select t.description,a.clock,a.value,t.triggerid from alarms a,triggers t where t.triggerid=a.triggerid order by clock desc limit ".($start+100); } $result=DBselect($sql); @@ -51,8 +57,14 @@ echo "<TD width=\"10%\"><b>Value</b></TD>"; echo "</TR>"; $col=0; + $i=0; while($row=DBfetch($result)) { + $i++; + if(isset($start)&&($i<$start)) + { + continue; + } if(!check_right_on_trigger("R",$row["triggerid"])) { continue; diff --git a/frontends/php/queue.php b/frontends/php/queue.php index bd3db8a1..8dcbb24a 100644 --- a/frontends/php/queue.php +++ b/frontends/php/queue.php @@ -17,9 +17,6 @@ <? show_table_header("QUEUE OF ITEMS TO BE UPDATED"); - echo "<br>"; - - show_table_header("QUEUE"); ?> <? $now=time(); diff --git a/frontends/php/users.php b/frontends/php/users.php index 86b5819e..e5206a40 100644 --- a/frontends/php/users.php +++ b/frontends/php/users.php @@ -65,11 +65,9 @@ <? show_table_header("CONFIGURATION OF USERS"); - echo "<br>"; ?> <? - show_table_header("USERS"); echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; echo "<TR><TD WIDTH=\"3%\"><B>Id</B></TD>"; echo "<TD WIDTH=\"10%\"><B>Alias</B></TD>"; diff --git a/include/functions.c b/include/functions.c index bf01b2d3..f405bf64 100644 --- a/include/functions.c +++ b/include/functions.c @@ -578,7 +578,7 @@ void update_services(int triggerid, int status) if(DBis_empty(result) == SUCCEED) { - zabbix_log( LOG_LEVEL_WARNING, "No service for this triggerid [%d]", triggerid); + zabbix_log( LOG_LEVEL_DEBUG, "No service for this triggerid [%d]", triggerid); DBfree_result(result); return; } diff --git a/src/zabbix_agent/sysinfo.c b/src/zabbix_agent/sysinfo.c index e675240a..386492e1 100644 --- a/src/zabbix_agent/sysinfo.c +++ b/src/zabbix_agent/sysinfo.c @@ -1229,7 +1229,7 @@ float DISK_WBLK(void) char *VERSION(void) { - static char version[]="1.0beta3\n"; + static char version[]="1.0beta4\n"; return version; } diff --git a/src/zabbix_sucker/zabbix_sucker.c b/src/zabbix_sucker/zabbix_sucker.c index 6ed3efe0..adf2b29d 100644 --- a/src/zabbix_sucker/zabbix_sucker.c +++ b/src/zabbix_sucker/zabbix_sucker.c @@ -308,7 +308,7 @@ int get_value_SNMPv1(double *result,char *result_str,DB_ITEM *item) ) { *result=*vars->val.integer; - sprintf(result_str,"%d",*vars->val.integer); + sprintf(result_str,"%ld",(long)*vars->val.integer); } else if(vars->type == ASN_OCTET_STR) { |