# File checks doesnt work

**URL:** https://discourse.sensu.io/t/file-checks-doesnt-work/243
**Category:** Sensu Classic (EOL)
**Created:** [September 1, 2014, 12:59pm UTC](https://discourse.sensu.io/t/file-checks-doesnt-work/243 "2014-09-01T12:59:09Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![reachmani](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@reachmani](https://discourse.sensu.io/u/reachmani)
#### Post date: [September 1, 2014, 12:59pm UTC](https://discourse.sensu.io/t/file-checks-doesnt-work/243/1 "2014-09-01T12:59:09Z")

</div>

Hi,

I have put a file check using the community plugin.  
[https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files](https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files)

It works fine when I execute it manually on the agent machine but doesn’t execute via the sensu monitor. I get an error stating file not found. I’m I missing something?

{

“checks”: {

“check\_webserver\_log”: {

“handlers”: [“default”],

“command”: “/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -p Error”,

“interval”: 60,

“subscribers”: [“webservers”]

}

}

}

Also this plugin doesn’t support searching a pattern anywhere in the file. I only searches for the starting of the string. Any suggestions?

Thanks,

Mani

---

<div class="post-metadata">

### Author: ![Kyle\_Anderson](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@Kyle\_Anderson](https://discourse.sensu.io/u/Kyle_Anderson)
#### Post date: [September 1, 2014, 5:00pm UTC](https://discourse.sensu.io/t/file-checks-doesnt-work/243/2 "2014-09-01T17:00:15Z")

</div>

The plugin should support matching any pattern in the \*last\* line of the file:  
[https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64](https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64)

> **[Class: Regexp (Ruby 2.0.0)](https://ruby-doc.org/core-2.0.0/Regexp.html)**
>
> Class : Regexp - Ruby 2.0.0

Can you paste the error message you are getting verbatim? And what is  
giving that error message? (which sensu log)

> **···**
>
> On Mon, Sep 1, 2014 at 5:59 AM, reachmani \<reachmani@gmail.com\> wrote:
> 
> > Hi,
> > 
> > I have put a file check using the community plugin.  
> > [https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files](https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files)
> > 
> > It works fine when I execute it manually on the agent machine but doesn't  
> > execute via the sensu monitor. I get an error stating file not found. I'm I  
> > missing something?
> > 
> > {  
> > &nbsp;&nbsp;"checks": {  
> > &nbsp;&nbsp;&nbsp;&nbsp;"check\_webserver\_log": {  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"handlers": ["default"],  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"command": "/opt/sensu/embedded/bin/ruby  
> > /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -p Error",  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"interval": 60,  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"subscribers": ["webservers"]  
> > &nbsp;&nbsp;&nbsp;&nbsp;}  
> > &nbsp;&nbsp;}  
> > }
> > 
> > Also this plugin doesn't support searching a pattern anywhere in the file. I  
> > only searches for the starting of the string. Any suggestions?
> > 
> > Thanks,  
> > Mani

---

<div class="post-metadata">

### Author: ![reachmani](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@reachmani](https://discourse.sensu.io/u/reachmani)
#### Post date: [September 2, 2014, 4:30am UTC](https://discourse.sensu.io/t/file-checks-doesnt-work/243/3 "2014-09-02T04:30:30Z")

</div>

There are no errors in monitor or in agent. I see below error in Uchiwa GUI.

output

Tail CRITICAL: File not found

Also I changed the check script to match the pattern in the last 100 lines. Here is the updated script.

/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/\server.log -P Error -l 1000

Thanks,

Mani

> **···**
>
> On Monday, 1 September 2014 22:30:16 UTC+5:30, Kyle Anderson wrote:
> 
> > The plugin should support matching any pattern in the _last_ line of the file:  
> > [https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64](https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64)
> > 
> > [http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-i-match](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-i-match)
> > 
> > Can you paste the error message you are getting verbatim? And what is  
> > giving that error message? (which sensu log)
> > 
> > On Mon, Sep 1, 2014 at 5:59 AM, reachmani [reac...@gmail.com](mailto:reac...@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > I have put a file check using the community plugin.  
> > > [https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files](https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files)
> > 
> > > It works fine when I execute it manually on the agent machine but doesn’t  
> > > execute via the sensu monitor. I get an error stating file not found. I’m I  
> > > missing something?
> > > 
> > > {  
> > > “checks”: {  
> > > “check\_webserver\_log”: {  
> > > “handlers”: [“default”],  
> > > “command”: “/opt/sensu/embedded/bin/ruby  
> > > /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -p Error”,  
> > > “interval”: 60,  
> > > “subscribers”: [“webservers”]  
> > > }  
> > > }  
> > > }
> > > 
> > > Also this plugin doesn’t support searching a pattern anywhere in the file. I  
> > > only searches for the starting of the string. Any suggestions?
> > > 
> > > Thanks,  
> > > Mani

---

<div class="post-metadata">

### Author: ![reachmani](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@reachmani](https://discourse.sensu.io/u/reachmani)
#### Post date: [September 2, 2014, 4:43am UTC](https://discourse.sensu.io/t/file-checks-doesnt-work/243/4 "2014-09-02T04:43:45Z")

</div>

I also ran agent in debug mode, here is the log file.  
**sensu-client.log**

{“timestamp”:“2014-09-02T04:35:36.904666+0000”,“level”:“debug”,“message”:“publishing keepalive”,“payload”:{“name”:“P\_WEBSERVER02”,“address”:“10.0.0.32”,“subscriptions”:[“generic”,“webservers”],“version”:“0.13.1”,“timestamp”:1409632536}}

{“timestamp”:“2014-09-02T04:35:36.904859+0000”,“level”:“debug”,“message”:“subscribing to client subscriptions”}

{“timestamp”:“2014-09-02T04:35:36.904915+0000”,“level”:“debug”,“message”:“subscribing to a subscription”,“subscription”:“generic”}

{“timestamp”:“2014-09-02T04:35:36.905046+0000”,“level”:“debug”,“message”:“subscribing to a subscription”,“subscription”:“webservers”}

{“timestamp”:“2014-09-02T04:35:36.905135+0000”,“level”:“debug”,“message”:“scheduling standalone checks”}

{“timestamp”:“2014-09-02T04:35:36.905229+0000”,“level”:“debug”,“message”:“binding client tcp and udp sockets”,“options”:{“bind”:“127.0.0.1”,“port”:3030}}

{“timestamp”:“2014-09-02T04:35:56.905114+0000”,“level”:“debug”,“message”:“publishing keepalive”,“payload”:{“name”:“P\_WEBSERVER02”,“address”:“10.0.0.32”,“subscriptions”:[“generic”,“webservers”],“version”:“0.13.1”,“timestamp”:1409632556}}

{“timestamp”:“2014-09-02T04:36:16.906084+0000”,“level”:“debug”,“message”:“publishing keepalive”,“payload”:{“name”:“P\_WEBSERVER02”,“address”:“10.0.0.32”,“subscriptions”:[“generic”,“webservers”],“version”:“0.13.1”,“timestamp”:1409632576}}

{“timestamp”:“2014-09-02T04:36:26.825835+0000”,“level”:“info”,“message”:“received check request”,“check”:{“name”:“check\_webserver\_log”,“issued”:1409632586,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -P Error -l 1000”}}

{“timestamp”:“2014-09-02T04:36:26.826019+0000”,“level”:“debug”,“message”:“processing check”,“check”:{“name”:“check\_webserver\_log”,“issued”:1409632586,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -P Error -l 1000”}}

{“timestamp”:“2014-09-02T04:36:26.826093+0000”,“level”:“debug”,“message”:“attempting to execute check command”,“check”:{“name”:“check\_webserver\_log”,“issued”:1409632586,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -P Error -l 1000”}}

{“timestamp”:“2014-09-02T04:36:27.024157+0000”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“P\_WEBSERVER02”,“check”:{“name”:“check\_webserver\_log”,“issued”:1409632586,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -P Error -l 1000”,“executed”:1409632586,“duration”:0.198,“output”:“Tail CRITICAL: File not found\n”,“status”:2}}}

{“timestamp”:“2014-09-02T04:36:34.833509+0000”,“level”:“info”,“message”:“received check request”,“check”:{“name”:“check\_node\_proc”,“issued”:1409632594,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-procs.rb -p server.js -C 4”}}

{“timestamp”:“2014-09-02T04:36:34.833674+0000”,“level”:“debug”,“message”:“processing check”,“check”:{“name”:“check\_node\_proc”,“issued”:1409632594,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-procs.rb -p server.js -C 4”}}

{“timestamp”:“2014-09-02T04:36:34.833773+0000”,“level”:“debug”,“message”:“attempting to execute check command”,“check”:{“name”:“check\_node\_proc”,“issued”:1409632594,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-procs.rb -p server.js -C 4”}}

{“timestamp”:“2014-09-02T04:36:34.965420+0000”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“P\_WEBSERVER02”,“check”:{“name”:“check\_node\_proc”,“issued”:1409632594,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-procs.rb -p server.js -C 4”,“executed”:1409632594,“duration”:0.131,“output”:“CheckProcs OK: Found 4 matching processes; cmd /server.js/\n”,“status”:0}}}

{“timestamp”:“2014-09-02T04:36:36.907598+0000”,“level”:“debug”,“message”:“publishing keepalive”,“payload”:{“name”:“P\_WEBSERVER02”,“address”:“10.0.0.32”,“subscriptions”:[“generic”,“webservers”],“version”:“0.13.1”,“timestamp”:1409632596}}

{“timestamp”:“2014-09-02T04:36:56.909061+0000”,“level”:“debug”,“message”:“publishing keepalive”,“payload”:{“name”:“P\_WEBSERVER02”,“address”:“10.0.0.32”,“subscriptions”:[“generic”,“webservers”],“version”:“0.13.1”,“timestamp”:1409632616}}

{“timestamp”:“2014-09-02T04:37:16.910777+0000”,“level”:“debug”,“message”:“publishing keepalive”,“payload”:{“name”:“P\_WEBSERVER02”,“address”:“10.0.0.32”,“subscriptions”:[“generic”,“webservers”],“version”:“0.13.1”,“timestamp”:1409632636}}

{“timestamp”:“2014-09-02T04:37:26.826325+0000”,“level”:“info”,“message”:“received check request”,“check”:{“name”:“check\_webserver\_log”,“issued”:1409632646,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -P Error -l 1000”}}

{“timestamp”:“2014-09-02T04:37:26.826488+0000”,“level”:“debug”,“message”:“processing check”,“check”:{“name”:“check\_webserver\_log”,“issued”:1409632646,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -P Error -l 1000”}}

{“timestamp”:“2014-09-02T04:37:26.826580+0000”,“level”:“debug”,“message”:“attempting to execute check command”,“check”:{“name”:“check\_webserver\_log”,“issued”:1409632646,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -P Error -l 1000”}}

{“timestamp”:“2014-09-02T04:37:26.958314+0000”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“P\_WEBSERVER02”,“check”:{“name”:“check\_webserver\_log”,“issued”:1409632646,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -P Error -l 1000”,“executed”:1409632646,“duration”:0.132,“output”:“Tail CRITICAL: File not found\n”,“status”:2}}}

**Check executed manually**

/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -P Error -l 1000

Tail OK: No matches found

**Linux command output on the log file**

ls -lt /home/ec2-user/server.log

-rw-rw-r-- 1 ec2-user ec2-user 18579008 Sep 2 04:38 /home/ec2-user/server.log

I am puzzled.

Thanks,

Mani

> **···**
>
> On Tuesday, 2 September 2014 10:00:30 UTC+5:30, reachmani wrote:
> 
> > There are no errors in monitor or in agent. I see below error in Uchiwa GUI.
> 
> > 
> 
> > output
> 
> > Tail CRITICAL: File not found
> 
> > 
> 
> > 
> 
> > Also I changed the check script to match the pattern in the last 100 lines. Here is the updated script.
> 
> > /opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/\server.log -P Error -l 1000
> 
> > 
> 
> > Thanks,
> 
> > Mani
> 
> > On Monday, 1 September 2014 22:30:16 UTC+5:30, Kyle Anderson wrote:
> > 
> > > The plugin should support matching any pattern in the _last_ line of the file:  
> > > [https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64](https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64)
> > > 
> > > [http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-i-match](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-i-match)
> > > 
> > > Can you paste the error message you are getting verbatim? And what is  
> > > giving that error message? (which sensu log)
> > > 
> > > On Mon, Sep 1, 2014 at 5:59 AM, reachmani [reac...@gmail.com](mailto:reac...@gmail.com) wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I have put a file check using the community plugin.  
> > > > [https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files](https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files)
> > > 
> > > > It works fine when I execute it manually on the agent machine but doesn’t  
> > > > execute via the sensu monitor. I get an error stating file not found. I’m I  
> > > > missing something?
> > > > 
> > > > {  
> > > > “checks”: {  
> > > > “check\_webserver\_log”: {  
> > > > “handlers”: [“default”],  
> > > > “command”: “/opt/sensu/embedded/bin/ruby  
> > > > /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -p Error”,  
> > > > “interval”: 60,  
> > > > “subscribers”: [“webservers”]  
> > > > }  
> > > > }  
> > > > }
> > > > 
> > > > Also this plugin doesn’t support searching a pattern anywhere in the file. I  
> > > > only searches for the starting of the string. Any suggestions?
> > > > 
> > > > Thanks,  
> > > > Mani

---

<div class="post-metadata">

### Author: ![reachmani](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@reachmani](https://discourse.sensu.io/u/reachmani)
#### Post date: [September 2, 2014, 8:39am UTC](https://discourse.sensu.io/t/file-checks-doesnt-work/243/5 "2014-09-02T08:39:10Z")

</div>

Figured out the problem, it was to do with folder permission.

Thanks,

Mani

> **···**
>
> On Monday, 1 September 2014 18:29:09 UTC+5:30, reachmani wrote:
> 
> > Hi,
> 
> > 
> 
> > I have put a file check using the community plugin.  
> > [https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files](https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files)
> 
> > 
> 
> > It works fine when I execute it manually on the agent machine but doesn’t execute via the sensu monitor. I get an error stating file not found. I’m I missing something?
> 
> > 
> 
> > {
> 
> > “checks”: {
> 
> > “check\_webserver\_log”: {
> 
> > “handlers”: [“default”],
> 
> > “command”: “/opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -p Error”,
> 
> > “interval”: 60,
> 
> > “subscribers”: [“webservers”]
> 
> > }
> 
> > }
> 
> > }
> 
> > 
> 
> > Also this plugin doesn’t support searching a pattern anywhere in the file. I only searches for the starting of the string. Any suggestions?
> 
> > 
> 
> > Thanks,
> 
> > Mani

---

<div class="post-metadata">

### Author: ![Stella\_Tyler](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@Stella\_Tyler](https://discourse.sensu.io/u/Stella_Tyler)
#### Post date: [September 28, 2014, 4:20pm UTC](https://discourse.sensu.io/t/file-checks-doesnt-work/243/6 "2014-09-28T16:20:43Z")

</div>

I think Sensu comes from the Japanese name for a folding fan made from bamboo and paper, which represent the Fanout exchange concept utilized by the AMQP (protocol). The Sensu framework provides foundation for monitoring cloud infrastructure and applications. Fully extensible via source code, with active community.

> **···**
>
> * * *
> 
> Rugged Phone | Rugged Android Phone
> 
> On Monday, September 1, 2014 10:00:16 PM UTC+5, Kyle Anderson wrote:
> 
> > The plugin should support matching any pattern in the _last_ line of the file:  
> > [https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64](https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64)
> > 
> > [http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-i-](http://www.google.com/url?q=http%3A%2F%2Fwww.ruby-doc.org%2Fcore-2.0.0%2FRegexp.html%23method-i-match&sa=D&sntz=1&usg=AFQjCNHDy5fI4kEdsTTq13ybSceL3d2lUQ)  
> > timeli0e  
> > [match](http://www.google.com/url?q=http%3A%2F%2Fwww.ruby-doc.org%2Fcore-2.0.0%2FRegexp.html%23method-i-match&sa=D&sntz=1&usg=AFQjCNHDy5fI4kEdsTTq13ybSceL3d2lUQ)
> > 
> > Can you paste the error message you are getting verbatim? And what is  
> > giving that error message? (which sensu log)
> > 
> > On Mon, Sep 1, 2014 at 5:59 AM, reachmani [reac...@gmail.com](mailto:reac...@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > I have put a file check using the community plugin.  
> > > [https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files](https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files)
> > 
> > > It works fine when I execute it manually on the agent machine but doesn’t  
> > > execute via the sensu monitor. I get an error stating file not found. I’m I  
> > > missing something?
> > > 
> > > {  
> > > “checks”: {  
> > > “check\_webserver\_log”: {  
> > > “handlers”: [“default”],  
> > > “command”: “/opt/sensu/embedded/bin/ruby  
> > > /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -p Error”,  
> > > “interval”: 60,  
> > > “subscribers”: [“webservers”]  
> > > }  
> > > }  
> > > }
> > > 
> > > Also this plugin doesn’t support searching a pattern anywhere in the file. I  
> > > only searches for the starting of the string. Any suggestions?
> > > 
> > > Thanks,  
> > > Mani

---

<div class="post-metadata">

### Author: ![Stella\_Tyler](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@Stella\_Tyler](https://discourse.sensu.io/u/Stella_Tyler)
#### Post date: [September 28, 2014, 4:21pm UTC](https://discourse.sensu.io/t/file-checks-doesnt-work/243/7 "2014-09-28T16:21:33Z")

</div>

I think Sensu comes from the Japanese name for a folding fan made from bamboo and paper, which represent the Fanout exchange concept utilized by the AMQP (protocol). The Sensu framework provides foundation for monitoring cloud infrastructure and applications. Fully extensible via source code, with active community.

> **···**
>
> * * *
> 
> Rugged Phone | Rugged Android Phone
> 
> On Monday, September 1, 2014 10:00:16 PM UTC+5, Kyle Anderson wrote:
> 
> > The plugin should support matching any pattern in the _last_ line of the file:  
> > [https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64](https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64)
> > 
> > [http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-i-](http://www.google.com/url?q=http%3A%2F%2Fwww.ruby-doc.org%2Fcore-2.0.0%2FRegexp.html%23method-i-match&sa=D&sntz=1&usg=AFQjCNHDy5fI4kEdsTTq13ybSceL3d2lUQ)  
> > timeli0e  
> > [match](http://www.google.com/url?q=http%3A%2F%2Fwww.ruby-doc.org%2Fcore-2.0.0%2FRegexp.html%23method-i-match&sa=D&sntz=1&usg=AFQjCNHDy5fI4kEdsTTq13ybSceL3d2lUQ)
> > 
> > Can you paste the error message you are getting verbatim? And what is  
> > giving that error message? (which sensu log)
> > 
> > On Mon, Sep 1, 2014 at 5:59 AM, reachmani [reac...@gmail.com](mailto:reac...@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > I have put a file check using the community plugin.  
> > > [https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files](https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files)
> > 
> > > It works fine when I execute it manually on the agent machine but doesn’t  
> > > execute via the sensu monitor. I get an error stating file not found. I’m I  
> > > missing something?
> > > 
> > > {  
> > > “checks”: {  
> > > “check\_webserver\_log”: {  
> > > “handlers”: [“default”],  
> > > “command”: “/opt/sensu/embedded/bin/ruby  
> > > /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -p Error”,  
> > > “interval”: 60,  
> > > “subscribers”: [“webservers”]  
> > > }  
> > > }  
> > > }
> > > 
> > > Also this plugin doesn’t support searching a pattern anywhere in the file. I  
> > > only searches for the starting of the string. Any suggestions?
> > > 
> > > Thanks,  
> > > Mani

---

<div class="post-metadata">

### Author: ![Stella\_Tyler](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@Stella\_Tyler](https://discourse.sensu.io/u/Stella_Tyler)
#### Post date: [September 28, 2014, 4:22pm UTC](https://discourse.sensu.io/t/file-checks-doesnt-work/243/8 "2014-09-28T16:22:28Z")

</div>

I think Sensu comes from the Japanese name for a folding fan made from bamboo and paper, which represent the Fanout exchange concept utilized by the AMQP (protocol). The Sensu framework provides foundation for monitoring cloud infrastructure and applications. Fully extensible via source code, with active community.

> **···**
>
> * * *
> 
> Rugged Phone | Rugged Android Phone
> 
> On Monday, September 1, 2014 10:00:16 PM UTC+5, Kyle Anderson wrote:
> 
> > The plugin should support matching any pattern in the _last_ line of the file:  
> > [https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64](https://github.com/sensu/sensu-community-plugins/blob/master/plugins/files/check-tail.rb#L58-L64)
> > 
> > [http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-i-](http://www.google.com/url?q=http%3A%2F%2Fwww.ruby-doc.org%2Fcore-2.0.0%2FRegexp.html%23method-i-match&sa=D&sntz=1&usg=AFQjCNHDy5fI4kEdsTTq13ybSceL3d2lUQ)  
> > timeli0e  
> > [match](http://www.google.com/url?q=http%3A%2F%2Fwww.ruby-doc.org%2Fcore-2.0.0%2FRegexp.html%23method-i-match&sa=D&sntz=1&usg=AFQjCNHDy5fI4kEdsTTq13ybSceL3d2lUQ)
> > 
> > Can you paste the error message you are getting verbatim? And what is  
> > giving that error message? (which sensu log)
> > 
> > On Mon, Sep 1, 2014 at 5:59 AM, reachmani [reac...@gmail.com](mailto:reac...@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > I have put a file check using the community plugin.  
> > > [https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files](https://github.com/sensu/sensu-community-plugins/tree/master/plugins/files)
> > 
> > > It works fine when I execute it manually on the agent machine but doesn’t  
> > > execute via the sensu monitor. I get an error stating file not found. I’m I  
> > > missing something?
> > > 
> > > {  
> > > “checks”: {  
> > > “check\_webserver\_log”: {  
> > > “handlers”: [“default”],  
> > > “command”: “/opt/sensu/embedded/bin/ruby  
> > > /etc/sensu/plugins/check-tail.rb -f /home/ec2-user/server.log -p Error”,  
> > > “interval”: 60,  
> > > “subscribers”: [“webservers”]  
> > > }  
> > > }  
> > > }
> > > 
> > > Also this plugin doesn’t support searching a pattern anywhere in the file. I  
> > > only searches for the starting of the string. Any suggestions?
> > > 
> > > Thanks,  
> > > Mani
