{"id":632,"date":"2014-02-22T22:44:33","date_gmt":"2014-02-22T13:44:33","guid":{"rendered":"http:\/\/nsb.homeip.net\/wp\/?p=632"},"modified":"2014-02-24T18:07:34","modified_gmt":"2014-02-24T09:07:34","slug":"zabbix-2-2-1-%e3%81%a7-mysql%e3%81%8b%e3%82%89%e7%9b%b4%e6%8e%a5item%e5%80%a4%e7%ad%89%e3%82%92%e5%8f%96%e5%be%97%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/nsb.homeip.net\/wp\/?p=632","title":{"rendered":"Zabbix 2.2.1 \u3067 MySQL\u304b\u3089\u76f4\u63a5ITEM\u5024\u7b49\u3092\u53d6\u5f97\u3057\u3066\u307f\u308b(TSV,CSV)"},"content":{"rendered":"<p>Zabbix 2.2.1\u3067\u5404\u30a2\u30a4\u30c6\u30e0\u306e\u5024\u3092\u30c7\u30fc\u30bf\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u3068\u304d\u306f\u3001<br \/>\n\u300c\u76e3\u8996\u30c7\u30fc\u30bf\u300d\uff0d\uff1e\u300c\u6700\u65b0\u30c7\u30fc\u30bf\u300d\uff0d\uff1e\u300c\u30b0\u30e9\u30d5\u300dor\u300c\u30d2\u30b9\u30c8\u30ea\u300d\u304b\u3089\u300c\u5024\u300d\u3092\u9078\u629e\u3059\u308b\u3068<br \/>\n\u300c\u30d7\u30ec\u30fc\u30f3\u30c6\u30ad\u30b9\u30c8\u300d\u30dc\u30bf\u30f3\u3067TSV\u5f62\u5f0f\u3067\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u306a\u305c\u304b1000\u500b\u3050\u3089\u3044\u307e\u3067\u3057\u304b<br \/>\n\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\uff081\u5206\u3054\u3068\u306e\u53d6\u5f97\u3059\u308b\u30a2\u30a4\u30c6\u30e0\u3060\u306816.6\u6642\u9593\u5206\u3057\u304b\u53d6\u5f97\u3067\u304d\u306a\u3044\uff09<\/p>\n<p>\u3057\u3087\u3046\u304c\u306a\u3044\u306e\u3067\u3001mysql\u306eDB\u306b\u304b\u3089\u76f4\u63a5\u60c5\u5831\uff57\u53d6\u5f97\u51fa\u6765\u306a\u3044\u304b\u3092\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u672c\u6765\u306f\u3001Zabbix API\u4f7f\u3046\u306e\u304c\u6b63\u5f53\u306a\u3093\u3060\u308d\u3046\u3051\u3069\u3001\u73fe\u72b6\u3046\u307e\u304f\u4f7f\u3044\u3053\u306a\u305b\u307e\u305b\u3093\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u307e\u305a\u306fmysql\u306e\u4f7f\u3044\u65b9\u3092\u78ba\u8a8d<\/p>\n<p>mysql\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3067\u5b9f\u884c\uff08\u8868\u5f62\u5f0f\u3067\u51fa\u529b\u3055\u308c\u307e\u3059\uff09<\/p>\n<pre># mysql zabbix\r\n&gt; (\u3053\u3053\u306bSQL\u3092\u5165\u529b\u3002\u6700\u5f8c\u306b;)<\/pre>\n<p>\u76f4\u63a5SQL\u5206\u3092\u6307\u5b9a\u3057\u3066\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre>\u76f4\u63a5SQL\u5206\u3092\u8a18\u8ff0\r\n# mysql zabbix -e \"(SQL\u6587)\"\r\n\r\nSQL\u3092\u8a18\u8ff0\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u5b9f\u884c\r\n# mysql zabbix -e \"`cat outcsv.sql`\"<\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u306b\uff54\uff53\uff56\u51fa\u529b\u3059\u308b\u306b\u306f\u3001\u5358\u7d14\u306b\u6a19\u6e96\u51fa\u529b\u3092\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308c\u3070\u3088\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n<pre># mysql zabbix -e \"(SQL\u6587)\" &gt; \/tmp\/test2.tsv\r\n\r\n\u4f8b\r\n# mysql zabbix -e \"select h.host, h.name, i.name, i.description, i.key_ from items i join hosts h on h.hostid = i.hostid where h.name = 'N54L' order by i.key_ \" &gt; \/tmp\/test2.tsv<\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u306bcsv\u51fa\u529b\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306btab\u3092&#8217;,&#8217;\u306b\u5909\u63db\u3057\u3066\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre># mysql zabbix -e \"(SQL\u6587)\" | sed -e 's\/\\t\/,\/g' &gt; test.csv<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b9f\u969b\u306b\u3001Zabbix 2.2.1\u306eDB\u304b\u3089\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30db\u30b9\u30c8\u4e00\u89a7\u53d6\u5f97<\/li>\n<li>\u30db\u30b9\u30c8\u3054\u3068\u306e\u76e3\u8996\u9805\u76ee\u4e00\u89a7\u53d6\u5f97<\/li>\n<li>\u6307\u5b9a\u30db\u30b9\u30c8\u306e\u30a2\u30a4\u30c6\u30e0\u6700\u65b0\u5024\u4e00\u89a7\u53d6\u5f97<\/li>\n<li>\u30a2\u30a4\u30c6\u30e0\u5024\u5168\u53d6\u5f97<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>\u30db\u30b9\u30c8\u4e00\u89a7\u3092\u53d6\u5f97<\/p>\n<pre>SELECT\r\n host,\r\n name, \r\n status,\r\n flags \r\nFROM hosts\r\nWHERE STATUS &lt;&gt; 3 AND\r\n      flags &lt;&gt; 2\r\norder by name;<\/pre>\n<pre>+--------------------------------------+--------------------------+--------+-------+\r\n| host                                 | name                     | status | flags |\r\n+--------------------------------------+--------------------------+--------+-------+\r\n| 192.168.29.18                        | 192.168.29.18            | 1      | 0     |\r\n| 192.168.29.19                        | 192.168.29.19            | 1      | 0     |\r\n| 192.168.29.81                        | N54L                     | 0      | 0     |\r\n| 192.168.29.200                       | NS001                    | 0      | 0     |\r\n| 420c8e7f-4f1a-d635-6278-334d351ff20b | NS001_onESXi             | 0      | 4     |\r\n| 192.168.29.201                       | NS002                    | 0      | 0     |\r\n| 564d632b-457a-9773-3019-ba1a68e2c7b5 | NS002_onESXi             | 0      | 4     |\r\n| 192.168.29.241                       | VMSV01                   | 0      | 0     |\r\n| 4c49f06c-6c06-2003-0001-005800232010 | VMSV01.nsb.homeip.net    | 0      | 4     |\r\n| 192.168.29.242                       | VMSV02                   | 0      | 0     |\r\n| 1c6f65e1-b358-1128-0023-004800282010 | VMSV02.nsb.homeip.net    | 0      | 4     |\r\n| 192.168.29.150                       | Walbrix                  | 0      | 0     |\r\n| 564da1e0-77d9-b8e2-c6eb-0ecf979b0db5 | Walbrix_onESXi           | 0      | 4     |\r\n| 192.168.29.151                       | wordpress                | 0      | 0     |\r\n| Zabbix server                        | Zabbix server            | 0      | 0     |\r\n| 192.168.29.153                       | zabbix2                  | 0      | 0     |\r\n+--------------------------------------+--------------------------+--------+-------+\r\n68 rows in set (0.00 sec)<\/pre>\n<pre>\u305f\u3076\u3093\u4ee5\u4e0b\u306e\u610f\u5473\r\nstatus=0 : \u6709\u52b9\u306a\u30db\u30b9\u30c8\r\nstatus=1 : \u7121\u52b9\u5316\u3055\u308c\u305f\u30db\u30b9\u30c8\r\nstatus=3 : \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\r\nflags=2  : \u30c7\u30a3\u30b9\u30ab\u30d0\u30ea\u7528\u5b9a\u7fa9\r\nflags=4  : \u30c7\u30a3\u30b9\u30ab\u30d0\u30ea\u3067\u81ea\u52d5\u767b\u9332\u3055\u308c\u305f\u30db\u30b9\u30c8<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u30db\u30b9\u30c8\u3054\u3068\u306e\u76e3\u8996\u9805\u76ee\u4e00\u89a7\u3092\u8868\u793a<\/p>\n<pre>select\r\n h.host,\r\n h.name,\r\n i.key_,\r\n i.delay,\r\n i.history,\r\n i.trends,\r\n ELT(i.value_type+1,'Double','Str','Log','Uint','Text') type,\r\n i.units ,\r\n ifnull(ap.name,'[Undefined]') application_name,\r\n i.name item_name,\r\n Replace(Replace( i.description , Char(13), \"\"),Char(10), \"\") AS description\r\nfrom items i \r\njoin hosts h \r\n on h.hostid = i.hostid \r\nleft join items_applications ia \r\n on i.itemid=ia.itemid \r\nleft join applications ap \r\n on h.hostid=ap.hostid and \r\n    ia.applicationid=ap.applicationid \r\nwhere h.host = '192.168.29.81' and\r\n i.status = 0 and\r\n i.flags &lt;&gt; 1 and\r\n i.flags &lt;&gt; 2\r\norder by ap.name, i.name,i.key_;<\/pre>\n<pre>+---------------+------+--------------------------------------------------------------------------------+-------+---------+--------+--------+--------+--------------------+------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\r\n| host          | name | key_                                                                           | delay | history | trends | type   | units  | application_name   | item_name                          | description                                                                                                                                                                                                                                                                                                                                                                                                                                |\r\n+---------------+------+--------------------------------------------------------------------------------+-------+---------+--------+--------+--------+--------------------+------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\r\n| 192.168.29.81 | N54L | system.cpu.load[percpu,avg1]                                                   |    60 |       7 |    365 | Double |        | CPU                | Processor load (1 min average)     |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | system.cpu.load[percpu,avg15]                                                  |    60 |       7 |    365 | Double |        | CPU                | Processor load (15 min average)    |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | system.cpu.load[percpu,avg5]                                                   |    60 |       7 |    365 | Double |        | CPU                | Processor load (5 min average)     |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | vm.memory.size[total]                                                          |  3600 |       7 |    365 | Uint   | B      | Filesystems        | Total memory                       |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | sysContact                                                                     |  3600 |       7 |    365 | Str    |        | General            | Device contact details             | The textual identification of the contact person for this managed node, together with information on how to contact this person.  If no contact information is known, the value is the zero-length string.                                                                                                                                                                                                                                 |\r\n| 192.168.29.81 | N54L | sysDescr                                                                       |  3600 |       7 |    365 | Str    |        | General            | Device description                 | A textual description of the entity.  This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software.                                                                                                                                                                                                                                                |\r\n| 192.168.29.81 | N54L | sysLocation                                                                    |  3600 |       7 |    365 | Str    |        | General            | Device location                    | The physical location of this node (e.g., `telephone closet, 3rd floor').  If the location is unknown, the value is the zero-length string.                                                                                                                                                                                                                                                                                                |\r\n| 192.168.29.81 | N54L | sysName                                                                        |  3600 |       7 |    365 | Str    |        | General            | Device name                        | An administratively-assigned name for this managed node. By convention, this is the node's fully-qualified domain name.  If the name is unknown, the value is the zero-length string.                                                                                                                                                                                                                                                      |\r\n| 192.168.29.81 | N54L | sysUpTime                                                                      |    60 |       7 |    365 | Uint   | uptime | General            | Device uptime                      | The time since the network management portion of the system was last re-initialized.                                                                                                                                                                                                                                                                                                                                                       |\r\n| 192.168.29.81 | N54L | system.uname                                                                   |  3600 |       7 |    365 | Str    |        | General            | System information                 |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | system.uptime                                                                  |    60 |       7 |    365 | Uint   | uptime | General            | System uptime                      |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | icmppingloss                                                                   |   120 |       7 |    365 | Double | %      | ICMP               | ICMP loss                          |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | icmpping                                                                       |   120 |       7 |    365 | Uint   |        | ICMP               | ICMP ping                          |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | icmppingsec                                                                    |   120 |       7 |    365 | Double | s      | ICMP               | ICMP response time                 |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | vm.memory.size[free]                                                           |    60 |       7 |    365 | Uint   | B      | Memory             | Free memory                        |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | system.swap.size[,free]                                                        |    60 |       7 |    365 | Uint   | B      | Memory             | Free swap space                    |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | system.swap.size[,total]                                                       |  3600 |       7 |    365 | Uint   | B      | Memory             | Total swap space                   |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | proc.num[]                                                                     |    60 |       7 |    365 | Uint   |        | Processes          | Number of processes                |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | hrProcessorLoad[3]                                                             |    60 |      90 |    365 | Uint   | %      | Processors         | Utilization of processor #$1       | The average, over the last minute, of the percentage of time that this processor was not idle. Implementations may approximate this one minute smoothing period if necessary.                                                                                                                                                                                                                                                              |\r\n| 192.168.29.81 | N54L | hrProcessorLoad[4]                                                             |    60 |      90 |    365 | Uint   | %      | Processors         | Utilization of processor #$1       | The average, over the last minute, of the percentage of time that this processor was not idle. Implementations may approximate this one minute smoothing period if necessary.                                                                                                                                                                                                                                                              |\r\n| 192.168.29.81 | N54L | agent.ping                                                                     |    60 |       7 |    365 | Uint   |        | Zabbix agent       | Agent ping                         | The agent always returns 1 for this item. It could be used in combination with nodata() for availability check.                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | agent.hostname                                                                 |  3600 |       7 |    365 | Str    |        | Zabbix agent       | Host name of zabbix_agentd running |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L | agent.version                                                                  |  3600 |       7 |    365 | Str    |        | Zabbix agent       | Version of zabbix_agent(d) running |                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n+---------------+------+--------------------------------------------------------------------------------+-------+---------+--------+--------+--------+--------------------+------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\r\n293 rows in set (10 min 9.60 sec)<\/pre>\n<pre>\u305f\u3076\u3093\u4ee5\u4e0b\u306e\u610f\u5473\r\nstatus=0 : \u6709\u52b9\u306a\u30a2\u30a4\u30c6\u30e0\r\nstatus=1 : \u7121\u52b9\u5316\u3055\u308c\u305f\u30a2\u30a4\u30c6\u30e0\r\nflags=1  : \u30c7\u30a3\u30b9\u30ab\u30d0\u30ea\u7528\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5b9a\u7fa9\r\nflags=2  : \u30c7\u30a3\u30b9\u30ab\u30d0\u30ea\u7528\u9805\u76ee\u5b9a\u7fa9<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u6307\u5b9a\u30db\u30b9\u30c8\u306e\u30a2\u30a4\u30c6\u30e0\u6700\u65b0\u5024\u4e00\u89a7<\/p>\n<pre>select \r\n h.host AS HOST, \r\n h.name AS HOST_NAME, \r\n i.name AS ITEM_NAME, \r\n i.key_ as ITEM_KEY, \r\n FROM_UNIXTIME(ELT(i.value_type+1, hy1.clock, hy3.clock, hy2.clock, hy5.clock, hy4.clock))                                  AS  clock ,\r\n Replace(Replace( ELT(i.value_type+1, hy1.value, hy3.value, hy2.value, hy5.value, hy4.value) , Char(13), \"\"),Char(10), \"\")  AS  value\r\nfrom items i\r\njoin hosts h on h.hostid = i.hostid \r\nleft join history      hy1 on hy1.itemid = i.itemid and hy1.clock = (select max(hy12.clock) from history      hy12 where hy12.itemid = i.itemid)\r\nleft join history_log  hy2 on hy2.itemid = i.itemid and hy2.clock = (select max(hy22.clock) from history_log  hy22 where hy22.itemid = i.itemid)\r\nleft join history_str  hy3 on hy3.itemid = i.itemid and hy3.clock = (select max(hy32.clock) from history_str  hy32 where hy32.itemid = i.itemid)\r\nleft join history_text hy4 on hy4.itemid = i.itemid and hy4.clock = (select max(hy42.clock) from history_text hy42 where hy42.itemid = i.itemid)\r\nleft join history_uint hy5 on hy5.itemid = i.itemid and hy5.clock = (select max(hy52.clock) from history_uint hy52 where hy52.itemid = i.itemid)\r\nwhere h.host = '192.168.29.81' and\r\n      i.status = 0             and \r\n      i.name like '%'          and \r\n      i.flags &lt;&gt; 1             and\r\n      i.flags &lt;&gt; 2             and\r\n      i.key_ like '%';<\/pre>\n<pre>+---------------+-----------+------------------------------------+--------------------------------------------------------------------------------+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\r\n| HOST          | HOST_NAME | ITEM_NAME                          | ITEM_KEY                                                                       | clock               | value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n+---------------+-----------+------------------------------------+--------------------------------------------------------------------------------+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\r\n| 192.168.29.81 | N54L      | Host name of zabbix_agentd running | agent.hostname                                                                 | 2014-02-03 23:58:40 | 192.168.29.81                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\r\n| 192.168.29.81 | N54L      | Agent ping                         | agent.ping                                                                     | 2014-02-04 00:38:41 | 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\r\n| 192.168.29.81 | N54L      | Version of zabbix_agent(d) running | agent.version                                                                  | 2014-02-03 23:58:42 | 2.2.1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |\r\n| 192.168.29.81 | N54L      | Utilization of processor #$1       | hrProcessorLoad[3]                                                             | 2014-02-04 00:38:54 | 35                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\r\n| 192.168.29.81 | N54L      | Utilization of processor #$1       | hrProcessorLoad[4]                                                             | 2014-02-04 00:38:55 | 45                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\r\n| 192.168.29.81 | N54L      | ICMP ping                          | icmpping                                                                       | 2014-02-04 00:38:22 | 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\r\n| 192.168.29.81 | N54L      | ICMP loss                          | icmppingloss                                                                   | 2014-02-04 00:38:24 | 0.0000                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\r\n| 192.168.29.81 | N54L      | ICMP response time                 | icmppingsec                                                                    | 2014-02-04 00:38:24 | 0.0011                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\r\n| 192.168.29.81 | N54L      | Number of processes                | proc.num[]                                                                     | 2014-02-04 00:38:48 | 53                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\r\n| 192.168.29.81 | N54L      | Device contact details             | sysContact                                                                     | 2014-02-04 00:34:22 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\r\n| 192.168.29.81 | N54L      | Device description                 | sysDescr                                                                       | 2014-02-04 00:34:23 | Hardware: AMD64 Family 16 Model 6 Stepping 3 AT\/AT COMPATIBLE - Software: Windows Version 6.1 (Build 7601 Multiprocessor Free)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\r\n| 192.168.29.81 | N54L      | Device location                    | sysLocation                                                                    | 2014-02-04 00:34:24 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\r\n| 192.168.29.81 | N54L      | Device name                        | sysName                                                                        | 2014-02-04 00:34:25 | N54L                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\r\n| 192.168.29.81 | N54L      | Processor load (15 min average)    | system.cpu.load[percpu,avg15]                                                  | 2014-02-04 00:38:49 | 1.1439                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average)     | system.cpu.load[percpu,avg1]                                                   | 2014-02-04 00:38:50 | 0.2083                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\r\n| 192.168.29.81 | N54L      | Processor load (5 min average)     | system.cpu.load[percpu,avg5]                                                   | 2014-02-04 00:38:51 | 0.3100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\r\n| 192.168.29.81 | N54L      | Free swap space                    | system.swap.size[,free]                                                        | 2014-02-04 00:38:52 | 14834892800                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\r\n| 192.168.29.81 | N54L      | Total swap space                   | system.swap.size[,total]                                                       | 2014-02-03 23:58:53 | 16907833344                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\r\n| 192.168.29.81 | N54L      | System information                 | system.uname                                                                   | 2014-02-03 23:58:54 | Windows N54L 6.1.7601 Microsoft Windows 7 Ultimate Edition Service Pack 1 x64                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\r\n| 192.168.29.81 | N54L      | System uptime                      | system.uptime                                                                  | 2014-02-04 00:38:55 | 148811                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\r\n| 192.168.29.81 | N54L      | Device uptime                      | sysUpTime                                                                      | 2014-02-04 00:38:26 | 148761                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\r\n| 192.168.29.81 | N54L      | Free memory                        | vm.memory.size[free]                                                           | 2014-02-04 00:38:56 | 6625419264                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |\r\n| 192.168.29.81 | N54L      | Total memory                       | vm.memory.size[total]                                                          | 2014-02-03 23:58:57 | 8454860800                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |\r\n+---------------+-----------+------------------------------------+--------------------------------------------------------------------------------+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u30a2\u30a4\u30c6\u30e0\u5024\u5168\u53d6\u5f97\uff08\u7279\u5b9a\u9805\u76ee,\u5168\u9805\u76ee\u3082\u8868\u793a\u3067\u304d\u308b\u304c\u3001\u975e\u5e38\u306b\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\uff09<\/p>\n<pre>select \r\n h.host AS HOST, \r\n h.name AS HOST_NAME, \r\n i.name AS ITEM_NAME, \r\n i.key_ as ITEM_KEY, \r\n FROM_UNIXTIME(ELT(i.value_type+1, hy1.clock, hy3.clock, hy2.clock, hy5.clock, hy4.clock))                                  AS  clock ,\r\n Replace(Replace( ELT(i.value_type+1, hy1.value, hy3.value, hy2.value, hy5.value, hy4.value) , Char(13), \"\"),Char(10), \"\")  AS  value\r\nfrom items i\r\njoin hosts h on h.hostid = i.hostid \r\nleft join history      hy1 on hy1.itemid = i.itemid \r\nleft join history_log  hy2 on hy2.itemid = i.itemid \r\nleft join history_str  hy3 on hy3.itemid = i.itemid \r\nleft join history_text hy4 on hy4.itemid = i.itemid \r\nleft join history_uint hy5 on hy5.itemid = i.itemid \r\nwhere h.host = '192.168.29.81' and\r\n      i.status = 0             and \r\n      i.name like '%'          and \r\n      i.key_ like 'system.cpu.load[percpu,avg1]%';<\/pre>\n<pre>+---------------+-----------+--------------------------------+------------------------------+---------------------+--------+\r\n| HOST          | HOST_NAME | ITEM_NAME                      | ITEM_KEY                     | clock               | value  |\r\n+---------------+-----------+--------------------------------+------------------------------+---------------------+--------+\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:47:50 | 0.3917 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:48:50 | 0.3250 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:49:50 | 0.7083 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:50:50 | 0.0833 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:51:50 | 0.1833 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:52:50 | 0.3500 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:53:50 | 0.5583 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:54:50 | 0.7667 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:55:50 | 0.5000 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:56:50 | 0.1750 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:57:50 | 0.1833 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:58:50 | 1.4250 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 00:59:50 | 2.3167 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 01:00:50 | 1.0167 |\r\n| 192.168.29.81 | N54L      | Processor load (1 min average) | system.cpu.load[percpu,avg1] | 2014-02-04 01:01:50 | 0.1083 |\r\n+---------------+-----------+--------------------------------+------------------------------+---------------------+--------+\r\n10121 rows in set (58 min 12.63 sec)<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u306b\u3059\u308c\u3070\u3001\u60c5\u5831\u306f\u53d6\u5f97\u3067\u304d\u305d\u3046\u3067\u3059\u304c\u3001<br \/>\nZabbix \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u4e0a\u304c\u3063\u305f\u6642\u306b\u5bfe\u5fdc\u3067\u304d\u306a\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u306e\u304c\u6b8b\u5ff5\u3002<\/p>\n<p>\u3042\u3068\u3001mysql\u306e\u8a2d\u5b9a\u304c\u6a19\u6e96\u3060\u3068\u691c\u7d22\u306b\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002<br \/>\n\u5b9f\u969b\u306b\u306f\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u5fc5\u9808\u306a\u3088\u3046\u3067\u3059\uff08\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u65b9\u6cd5\u306f\u307e\u305f\u4eca\u5ea6\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>Views: 29<\/p>","protected":false},"excerpt":{"rendered":"<p>Zabbix 2.2.1\u3067\u5404\u30a2\u30a4\u30c6\u30e0\u306e\u5024\u3092\u30c7\u30fc\u30bf\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u3068\u304d\u306f\u3001 \u300c\u76e3\u8996\u30c7\u30fc\u30bf\u300d\uff0d\uff1e\u300c\u6700\u65b0\u30c7\u30fc\u30bf\u300d\uff0d\uff1e\u300c\u30b0\u30e9\u30d5\u300dor\u300c\u30d2\u30b9\u30c8\u30ea\u300d\u304b\u3089\u300c\u5024\u300d\u3092\u9078\u629e\u3059\u308b\u3068 \u300c\u30d7\u30ec\u30fc\u30f3\u30c6\u30ad\u30b9\u30c8\u300d\u30dc\u30bf\u30f3\u3067TSV\u5f62\u5f0f\u3067\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u304c\u3001 &hellip; <a href=\"https:\/\/nsb.homeip.net\/wp\/?p=632\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[11],"tags":[24],"class_list":["post-632","post","type-post","status-publish","format-standard","hentry","category-zabbix","tag-mysql"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/nsb.homeip.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nsb.homeip.net\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nsb.homeip.net\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nsb.homeip.net\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nsb.homeip.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=632"}],"version-history":[{"count":0,"href":"https:\/\/nsb.homeip.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/632\/revisions"}],"wp:attachment":[{"href":"https:\/\/nsb.homeip.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsb.homeip.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsb.homeip.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}