Go to advanced search

by kainaat
Wed Jun 27, 2018 11:54 am
Forum: General discussion
Topic: Permission denied (publickey) with password dsiabled
Replies: 1
Views: 301

Permission denied (publickey) with password dsiabled

I have a PI which I can only reach via SSH (on port 97 - which is open and waiting for a response) and while setting the PI up I disabled the password inside /etc/ssh/sshd_config However now I can't connect to it as it's failing at the public key, I'm not sure if the keys have been changed but is th...
by kainaat
Wed Mar 28, 2018 9:54 am
Forum: General discussion
Topic: Monitoring a csv file on PI
Replies: 0
Views: 125

Monitoring a csv file on PI

My HTML file: <style> #circleRed { background: #ff0000; width: 15px; height: 15px; border-radius: 50%; } #circleGreen { background: #00ff00; width: 15px; height: 15px; border-radius: 50px; } </style> <div id="circleRed"></div> <div id="circleGreen"></div> Has a PHP script: <?php function ReturnError...
by kainaat
Fri Mar 23, 2018 12:27 pm
Forum: General discussion
Topic: How to monitor a /var/log file
Replies: 9
Views: 850

Re: How to monitor a /var/log file

It works.. hurray!!

Using your code and changing:

Code: Select all

 $output = shell_exec($command);
To just using exec:

Code: Select all

$output = exec($command);
And now I can see the error messages!

Many thanks for your support!
by kainaat
Thu Mar 22, 2018 12:54 pm
Forum: General discussion
Topic: How to monitor a /var/log file
Replies: 9
Views: 850

Re: How to monitor a /var/log file

Sorry if I haven't been clear, but if the error code is 0, my log file outputs: 2018-03-22 12:28:34,NM_Test.h264,0 For any other code, it'll be a minus number: 2018-03-22 12:28:34,NM_Test.h264,-2 When I added the default case I got: Currently Playing: 2018-03-22 12:34:53,NM_Test.h264,-- I assumed th...
by kainaat
Wed Mar 21, 2018 3:57 pm
Forum: General discussion
Topic: How to monitor a /var/log file
Replies: 9
Views: 850

Re: How to monitor a /var/log file

This is exactly what I need!!! Thank you! But I can't get seem to get the corresponding case message to display: Currently playing: 2018-03-21 15:21:13,NM_Test.h264, Where am I going wrong? What if you create a function to output the custom errors for you? <?php function ReturnError($res) { switch (...
by kainaat
Wed Mar 21, 2018 12:37 pm
Forum: General discussion
Topic: How to monitor a /var/log file
Replies: 9
Views: 850

Re: How to monitor a /var/log file

Your bash script is a far better way to achieve what I attempted to do using PHP. So I will use your script instead. However, I'm still a stuck on a solution to my original question. To clarify, I have a player.bin file which writes to playlog.csv file of every video the omx player plays. So for me ...
by kainaat
Wed Mar 21, 2018 10:13 am
Forum: General discussion
Topic: How to monitor a /var/log file
Replies: 9
Views: 850

How to monitor a /var/log file

I have a .csv log file which I would like to monitor for error codes and print a message when an error code is found. PHP script: <?php $command = "ssh -p 97 -i /var/www/html/test.rsa pi@192.168.xx.xx tail -1 /var/log/playlog.csv"; $output = shell_exec($command); echo "Test PI <p></p>Status: <p></p>...
by kainaat
Tue Mar 13, 2018 10:39 am
Forum: General discussion
Topic: Allowing Apache server access to PI
Replies: 5
Views: 583

Re: Allowing Apache server access to PI

Inside my /var/log/apache2/error.log I can see I'm getting an host key verification error message: [Tue Mar 13 08:47:25.661029 2018] [core:notice] [pid 13450] AH00094: Command line: '/usr/sbin/apache2' Could not create directory '/var/www/.ssh'. Host key verification failed. We trust you have receiv...
by kainaat
Mon Mar 12, 2018 4:35 pm
Forum: General discussion
Topic: Allowing Apache server access to PI
Replies: 5
Views: 583

Re: Allowing Apache server access to PI

1 .Which user do you run as when testing in the console ? Running the command: whoami shows I am running as the 'manager' user. 2. Where is the keyfile "PI12.rsa" located ? On CMS server - /home/manager/keys/PI12.rsa Sorry I realised I have copied the wrong PHP script, it should be: $command = "ssh ...
by kainaat
Mon Mar 12, 2018 1:59 pm
Forum: General discussion
Topic: Allowing Apache server access to PI
Replies: 5
Views: 583

Allowing Apache server access to PI

I have various PIs running daemon services, and I'd like to set up a webpage to monitor the status of each daemon service. For this I have come up with following PHP script: <?php //dashboard.php $command = "ssh -p 97 -i PI12.rsa pi@192.xxx.xx.xx tail -5 /var/log/vidlog.csv ; sudo service surround s...

Go to advanced search