Hello All,
I try to monitor linux log files, we 're hosting web applications and I want to be notified
everytime errors are inside some applications log file.
First ; I tried zabbix_agentd Log monitoring but with some issues.
I would use zabbix_agentd UserParameter :
Here is my config :
Zabbix server 1.8
Zabbix Agentd 1.8
Zabbix_agentd conf :
Server=172.17.x.x,172.17.x.x
Hostname=adm1.xxx.xxx
ServerPort=10051
ListenPort=10050
StartAgents=3
DebugLevel=4
RefreshActiveChecks=120
MaxLinesPerSecond=10
EnableRemoteCommands=1
LogRemoteCommands=1
LogFileSize=5
LogFile=/var/log/zabbix_agentd/zabbix_agentd.log
LogUnresolvedSymbols=/var/log/zabbix_agentd/zabbix_unresolved_symbols.log
PidFile=/var/run/zabbix_agentd/zabbix_agentd.pid
Include=/etc/zabbix_agentd/include/
Timeout=30
## Parameters
UserParameter=STRING_OPTION1,egrep "option" /test25_logmon/tcsd.conf
UserParameter=STRING_OPTION2,egrep "option" /test25_logmon/tcsd.conf | awk '{print $2}'
UserParameter=STRING_OPTION3,egrep "option" /test25_logmon/tcsd.conf | awk '{print $2}' | wc -l
## End Parameters
I created 3 items (First test was with Type = Character end second test was with type = text) :
Item 1 : OPTION_STRING1 Type : Zabbix Agent (active) Key : OPTION_STRING1 Type : Text Update Interval : 60 History : 7
Item 2 : OPTION_STRING2 Type : Zabbix Agent (active) Key : OPTION_STRING2 Type : Text Update Interval : 60 History : 7
Item 3 : OPTION_STRING3 Type : Zabbix Agent (active) Key : OPTION_STRING3 Type : Text Update Interval : 60 History : 7
Trigger Item 1 : {adm1.xxx.xxx:OPTION_STRING1.str(option)}=1
No Trigger for Item 2.
Trigger Item 3 : {adm1.xxx.xxx:OPTION_STRING3.last(0)}#0
Each time I have in zabbix_agentd log ; the value "ZBX_NOTSUPPORTED" :
19459:20110117:102207.954 In send_buffer('172.17.x.x','10051')
19459:20110117:102207.954 Values in the buffer 0 Max 100
19459:20110117:102207.954 refresh_active_checks('172.17.x.x',10051)
19459:20110117:102207.957 Sending [{
"request":"active checks",
"host":"adm1.xxx.xxx"}]
19459:20110117:102207.957 Before read
19459:20110117:102207.958 Got [{
"response":"success",
"data":[
{
"key":"OPTION_STRING1",
"delay":"60",
"lastlogsize":"0",
"mtime":"0"},
{
"key":"OPTION_STRING2",
"delay":"60",
"lastlogsize":"0",
"mtime":"0"},
{
"key":"OPTION_STRING3",
"delay":"60",
"lastlogsize":"0",
"mtime":"0"}]}]
19459:20110117:102207.958 In parse_list_of_checks()
19459:20110117:102207.959 In disable_all_metrics()
19459:20110117:102207.959 In add_check('OPTION_STRING1', 60, 0, 0)
19459:20110117:102207.959 In add_check('OPTION_STRING2', 60, 0, 0)
19459:20110117:102207.959 In add_check('OPTION_STRING3', 60, 0, 0)
19459:20110117:102207.959 In process_active_checks('172.17.x.x',10051)
19459:20110117:102207.959 For key [OPTION_STRING1] received value [ZBX_NOTSUPPORTED]
19459:20110117:102207.959 In process_value('adm1.xxx.xxx','OPTION_STRING1','ZBX _NOTSUPPORTED')
19459:20110117:102207.959 In send_buffer('172.17.x.x','10051')
19459:20110117:102207.959 Values in the buffer 0 Max 100
19459:20110117:102207.959 Buffer: first allocation for 100 elements
19459:20110117:102207.960 Buffer: new element 0
19459:20110117:102207.960 Active check [OPTION_STRING1] is not supported. Disabled.
19459:20110117:102207.960 For key [OPTION_STRING2] received value [ZBX_NOTSUPPORTED]
19459:20110117:102207.960 In process_value('adm1.xxx.xxx','OPTION_STRING2','ZBX _NOTSUPPORTED')
19459:20110117:102207.960 In send_buffer('172.17.x.x','10051')
19459:20110117:102207.960 Values in the buffer 1 Max 100
19459:20110117:102207.960 JSON before sending [{
"request":"agent data",
"data":[
{
"host":"adm1.xxx.xxx",
"key":"OPTION_STRING1",
"value":"ZBX_NOTSUPPORTED",
"clock":1295256127}],
"clock":1295256127}]
19455:20110117:102208.172 In collector_diskdevice_get("")
19455:20110117:102208.172 In collector_diskdevice_get("sda")
19455:20110117:102208.172 In collector_diskdevice_get("sdb")
19455:20110117:102208.172 In collector_diskdevice_get("hda")
19459:20110117:102208.437 JSON back [{
"response":"success",
"info":"Processed 1 Failed 0 Total 1 Seconds spent 0.475726"}]
19459:20110117:102208.437 In check_response({
"response":"success",
"info":"Processed 1 Failed 0 Total 1 Seconds spent 0.475726"})
19459:20110117:102208.437 Info from server: Processed 1 Failed 0 Total 1 Seconds spent 0.475726
19459:20110117:102208.437 OK
19459:20110117:102208.437 Buffer: new element 0
19459:20110117:102208.437 Active check [OPTION_STRING2] is not supported. Disabled.
19459:20110117:102208.437 For key [OPTION_STRING3] received value [ZBX_NOTSUPPORTED]
19459:20110117:102208.437 In process_value('adm1.xxx.xxx','OPTION_STRING3','ZBX _NOTSUPPORTED')
19459:20110117:102208.437 In send_buffer('172.17.x.x','10051')
19459:20110117:102208.437 Values in the buffer 1 Max 100
19459:20110117:102208.437 Will not send now. Now 1295256128 lastsent 1295256127 < 5
19459:20110117:102208.438 Buffer: new element 1
19459:20110117:102208.438 Active check [OPTION_STRING3] is not supported. Disabled.
19459:20110117:102208.438 In get_min_nextcheck()
19459:20110117:102208.438 In send_buffer('172.17.x.x','10051')
19459:20110117:102208.438 Values in the buffer 2 Max 100
19459:20110117:102208.438 Will not send now. Now 1295256128 lastsent 1295256127 < 5
19459:20110117:102208.438 Sleeping for 1 seconds
19459:20110117:102209.439 In send_buffer('172.17.x.x','10051')
19459:20110117:102209.439 Values in the buffer 2 Max 100
19459:20110117:102209.439 Will not send now. Now 1295256129 lastsent 1295256127 < 5
19459:20110117:102209.440 Sleeping for 1 seconds
19459:20110117:102210.442 In send_buffer('172.17.x.x','10051')
19459:20110117:102210.442 Values in the buffer 2 Max 100
19459:20110117:102210.442 Will not send now. Now 1295256130 lastsent 1295256127 < 5
19459:20110117:102210.442 Sleeping for 1 seconds
19459:20110117:102211.445 In send_buffer('172.17.x.x','10051')
19459:20110117:102211.445 Values in the buffer 2 Max 100
19459:20110117:102211.445 Will not send now. Now 1295256131 lastsent 1295256127 < 5
19459:20110117:102211.445 Sleeping for 1 seconds
19459:20110117:102212.447 In send_buffer('172.17.x.x','10051')
19459:20110117:102212.447 Values in the buffer 2 Max 100
19459:20110117:102212.448 JSON before sending [{
"request":"agent data",
"data":[
{
"host":"adm1.xxx.xxx",
"key":"OPTION_STRING2",
"value":"ZBX_NOTSUPPORTED",
"clock":1295256128},
{
"host":"adm1.xxx.xxx",
"key":"OPTION_STRING3",
"value":"ZBX_NOTSUPPORTED",
"clock":1295256128}],
"clock":1295256132}]
19459:20110117:102212.484 JSON back [{
"response":"success",
"info":"Processed 2 Failed 0 Total 2 Seconds spent 0.035201"}]
19459:20110117:102212.484 In check_response({
"response":"success",
"info":"Processed 2 Failed 0 Total 2 Seconds spent 0.035201"})
19459:20110117:102212.484 Info from server: Processed 2 Failed 0 Total 2 Seconds spent 0.035201
19459:20110117:102212.484 OK
19459:20110117:102212.484 Sleeping for 1 seconds
19459:20110117:102213.485 In send_buffer('172.17.x.x','10051')
19459:20110117:102213.485 Values in the buffer 0 Max 100
19459:20110117:102213.485 Will not send now. Now 1295256133 lastsent 1295256132 < 5
19459:20110117:102213.486 Sleeping for 1 seconds
19459:20110117:102214.487 In send_buffer('172.17.x.x','10051')
19459:20110117:102214.487 Values in the buffer 0 Max 100
19459:20110117:102214.487 Will not send now. Now 1295256134 lastsent 1295256132 < 5
19459:20110117:102214.487 Sleeping for 1 seconds
19459:20110117:102215.489 In send_buffer('172.17.x.x','10051')
19459:20110117:102215.489 Values in the buffer 0 Max 100
19459:20110117:102215.489 Will not send now. Now 1295256135 lastsent 1295256132 < 5
19459:20110117:102215.489 Sleeping for 1 seconds
19459:20110117:102216.491 In send_buffer('172.17.x.x','10051')
19459:20110117:102216.491 Values in the buffer 0 Max 100
19459:20110117:102216.491 Will not send now. Now 1295256136 lastsent 1295256132 < 5
19459:20110117:102216.491 Sleeping for 1 seconds
19459:20110117:102217.492 In send_buffer('172.17.x.x','10051')
19459:20110117:102217.492 Values in the buffer 0 Max 100
19459:20110117:102217.492 Sleeping for 1 seconds
19459:20110117:102218.493 In send_buffer('172.17.x.x','10051')
19459:20110117:102218.493 Values in the buffer 0 Max 100
19459:20110117:102218.493 Sleeping for 1 seconds
19459:20110117:102219.495 In send_buffer('172.17.x.x','10051')
19459:20110117:102219.495 Values in the buffer 0 Max 100
19459:20110117:102219.496 Sleeping for 1 seconds
No items are available on zabbix GUI
Any idea will be appreciate.
Have a good day.
Many Thanks.
Bertrand.
I try to monitor linux log files, we 're hosting web applications and I want to be notified
everytime errors are inside some applications log file.
First ; I tried zabbix_agentd Log monitoring but with some issues.
I would use zabbix_agentd UserParameter :
Here is my config :
Zabbix server 1.8
Zabbix Agentd 1.8
Zabbix_agentd conf :
Server=172.17.x.x,172.17.x.x
Hostname=adm1.xxx.xxx
ServerPort=10051
ListenPort=10050
StartAgents=3
DebugLevel=4
RefreshActiveChecks=120
MaxLinesPerSecond=10
EnableRemoteCommands=1
LogRemoteCommands=1
LogFileSize=5
LogFile=/var/log/zabbix_agentd/zabbix_agentd.log
LogUnresolvedSymbols=/var/log/zabbix_agentd/zabbix_unresolved_symbols.log
PidFile=/var/run/zabbix_agentd/zabbix_agentd.pid
Include=/etc/zabbix_agentd/include/
Timeout=30
## Parameters
UserParameter=STRING_OPTION1,egrep "option" /test25_logmon/tcsd.conf
UserParameter=STRING_OPTION2,egrep "option" /test25_logmon/tcsd.conf | awk '{print $2}'
UserParameter=STRING_OPTION3,egrep "option" /test25_logmon/tcsd.conf | awk '{print $2}' | wc -l
## End Parameters
I created 3 items (First test was with Type = Character end second test was with type = text) :
Item 1 : OPTION_STRING1 Type : Zabbix Agent (active) Key : OPTION_STRING1 Type : Text Update Interval : 60 History : 7
Item 2 : OPTION_STRING2 Type : Zabbix Agent (active) Key : OPTION_STRING2 Type : Text Update Interval : 60 History : 7
Item 3 : OPTION_STRING3 Type : Zabbix Agent (active) Key : OPTION_STRING3 Type : Text Update Interval : 60 History : 7
Trigger Item 1 : {adm1.xxx.xxx:OPTION_STRING1.str(option)}=1
No Trigger for Item 2.
Trigger Item 3 : {adm1.xxx.xxx:OPTION_STRING3.last(0)}#0
Each time I have in zabbix_agentd log ; the value "ZBX_NOTSUPPORTED" :
19459:20110117:102207.954 In send_buffer('172.17.x.x','10051')
19459:20110117:102207.954 Values in the buffer 0 Max 100
19459:20110117:102207.954 refresh_active_checks('172.17.x.x',10051)
19459:20110117:102207.957 Sending [{
"request":"active checks",
"host":"adm1.xxx.xxx"}]
19459:20110117:102207.957 Before read
19459:20110117:102207.958 Got [{
"response":"success",
"data":[
{
"key":"OPTION_STRING1",
"delay":"60",
"lastlogsize":"0",
"mtime":"0"},
{
"key":"OPTION_STRING2",
"delay":"60",
"lastlogsize":"0",
"mtime":"0"},
{
"key":"OPTION_STRING3",
"delay":"60",
"lastlogsize":"0",
"mtime":"0"}]}]
19459:20110117:102207.958 In parse_list_of_checks()
19459:20110117:102207.959 In disable_all_metrics()
19459:20110117:102207.959 In add_check('OPTION_STRING1', 60, 0, 0)
19459:20110117:102207.959 In add_check('OPTION_STRING2', 60, 0, 0)
19459:20110117:102207.959 In add_check('OPTION_STRING3', 60, 0, 0)
19459:20110117:102207.959 In process_active_checks('172.17.x.x',10051)
19459:20110117:102207.959 For key [OPTION_STRING1] received value [ZBX_NOTSUPPORTED]
19459:20110117:102207.959 In process_value('adm1.xxx.xxx','OPTION_STRING1','ZBX _NOTSUPPORTED')
19459:20110117:102207.959 In send_buffer('172.17.x.x','10051')
19459:20110117:102207.959 Values in the buffer 0 Max 100
19459:20110117:102207.959 Buffer: first allocation for 100 elements
19459:20110117:102207.960 Buffer: new element 0
19459:20110117:102207.960 Active check [OPTION_STRING1] is not supported. Disabled.
19459:20110117:102207.960 For key [OPTION_STRING2] received value [ZBX_NOTSUPPORTED]
19459:20110117:102207.960 In process_value('adm1.xxx.xxx','OPTION_STRING2','ZBX _NOTSUPPORTED')
19459:20110117:102207.960 In send_buffer('172.17.x.x','10051')
19459:20110117:102207.960 Values in the buffer 1 Max 100
19459:20110117:102207.960 JSON before sending [{
"request":"agent data",
"data":[
{
"host":"adm1.xxx.xxx",
"key":"OPTION_STRING1",
"value":"ZBX_NOTSUPPORTED",
"clock":1295256127}],
"clock":1295256127}]
19455:20110117:102208.172 In collector_diskdevice_get("")
19455:20110117:102208.172 In collector_diskdevice_get("sda")
19455:20110117:102208.172 In collector_diskdevice_get("sdb")
19455:20110117:102208.172 In collector_diskdevice_get("hda")
19459:20110117:102208.437 JSON back [{
"response":"success",
"info":"Processed 1 Failed 0 Total 1 Seconds spent 0.475726"}]
19459:20110117:102208.437 In check_response({
"response":"success",
"info":"Processed 1 Failed 0 Total 1 Seconds spent 0.475726"})
19459:20110117:102208.437 Info from server: Processed 1 Failed 0 Total 1 Seconds spent 0.475726
19459:20110117:102208.437 OK
19459:20110117:102208.437 Buffer: new element 0
19459:20110117:102208.437 Active check [OPTION_STRING2] is not supported. Disabled.
19459:20110117:102208.437 For key [OPTION_STRING3] received value [ZBX_NOTSUPPORTED]
19459:20110117:102208.437 In process_value('adm1.xxx.xxx','OPTION_STRING3','ZBX _NOTSUPPORTED')
19459:20110117:102208.437 In send_buffer('172.17.x.x','10051')
19459:20110117:102208.437 Values in the buffer 1 Max 100
19459:20110117:102208.437 Will not send now. Now 1295256128 lastsent 1295256127 < 5
19459:20110117:102208.438 Buffer: new element 1
19459:20110117:102208.438 Active check [OPTION_STRING3] is not supported. Disabled.
19459:20110117:102208.438 In get_min_nextcheck()
19459:20110117:102208.438 In send_buffer('172.17.x.x','10051')
19459:20110117:102208.438 Values in the buffer 2 Max 100
19459:20110117:102208.438 Will not send now. Now 1295256128 lastsent 1295256127 < 5
19459:20110117:102208.438 Sleeping for 1 seconds
19459:20110117:102209.439 In send_buffer('172.17.x.x','10051')
19459:20110117:102209.439 Values in the buffer 2 Max 100
19459:20110117:102209.439 Will not send now. Now 1295256129 lastsent 1295256127 < 5
19459:20110117:102209.440 Sleeping for 1 seconds
19459:20110117:102210.442 In send_buffer('172.17.x.x','10051')
19459:20110117:102210.442 Values in the buffer 2 Max 100
19459:20110117:102210.442 Will not send now. Now 1295256130 lastsent 1295256127 < 5
19459:20110117:102210.442 Sleeping for 1 seconds
19459:20110117:102211.445 In send_buffer('172.17.x.x','10051')
19459:20110117:102211.445 Values in the buffer 2 Max 100
19459:20110117:102211.445 Will not send now. Now 1295256131 lastsent 1295256127 < 5
19459:20110117:102211.445 Sleeping for 1 seconds
19459:20110117:102212.447 In send_buffer('172.17.x.x','10051')
19459:20110117:102212.447 Values in the buffer 2 Max 100
19459:20110117:102212.448 JSON before sending [{
"request":"agent data",
"data":[
{
"host":"adm1.xxx.xxx",
"key":"OPTION_STRING2",
"value":"ZBX_NOTSUPPORTED",
"clock":1295256128},
{
"host":"adm1.xxx.xxx",
"key":"OPTION_STRING3",
"value":"ZBX_NOTSUPPORTED",
"clock":1295256128}],
"clock":1295256132}]
19459:20110117:102212.484 JSON back [{
"response":"success",
"info":"Processed 2 Failed 0 Total 2 Seconds spent 0.035201"}]
19459:20110117:102212.484 In check_response({
"response":"success",
"info":"Processed 2 Failed 0 Total 2 Seconds spent 0.035201"})
19459:20110117:102212.484 Info from server: Processed 2 Failed 0 Total 2 Seconds spent 0.035201
19459:20110117:102212.484 OK
19459:20110117:102212.484 Sleeping for 1 seconds
19459:20110117:102213.485 In send_buffer('172.17.x.x','10051')
19459:20110117:102213.485 Values in the buffer 0 Max 100
19459:20110117:102213.485 Will not send now. Now 1295256133 lastsent 1295256132 < 5
19459:20110117:102213.486 Sleeping for 1 seconds
19459:20110117:102214.487 In send_buffer('172.17.x.x','10051')
19459:20110117:102214.487 Values in the buffer 0 Max 100
19459:20110117:102214.487 Will not send now. Now 1295256134 lastsent 1295256132 < 5
19459:20110117:102214.487 Sleeping for 1 seconds
19459:20110117:102215.489 In send_buffer('172.17.x.x','10051')
19459:20110117:102215.489 Values in the buffer 0 Max 100
19459:20110117:102215.489 Will not send now. Now 1295256135 lastsent 1295256132 < 5
19459:20110117:102215.489 Sleeping for 1 seconds
19459:20110117:102216.491 In send_buffer('172.17.x.x','10051')
19459:20110117:102216.491 Values in the buffer 0 Max 100
19459:20110117:102216.491 Will not send now. Now 1295256136 lastsent 1295256132 < 5
19459:20110117:102216.491 Sleeping for 1 seconds
19459:20110117:102217.492 In send_buffer('172.17.x.x','10051')
19459:20110117:102217.492 Values in the buffer 0 Max 100
19459:20110117:102217.492 Sleeping for 1 seconds
19459:20110117:102218.493 In send_buffer('172.17.x.x','10051')
19459:20110117:102218.493 Values in the buffer 0 Max 100
19459:20110117:102218.493 Sleeping for 1 seconds
19459:20110117:102219.495 In send_buffer('172.17.x.x','10051')
19459:20110117:102219.495 Values in the buffer 0 Max 100
19459:20110117:102219.496 Sleeping for 1 seconds
No items are available on zabbix GUI
Any idea will be appreciate.
Have a good day.
Many Thanks.
Bertrand.

and you, do you speak French ? cause I'm a french guy.
Comment