kireol / getplexusers

Reads a plex media server log file and tells you the active users and connections
0 stars 1 forks source link

error when running #1

Open identd113 opened 11 years ago

identd113 commented 11 years ago

/Users/plexserver/Library/Logs/Plex Media Server.log is log location

plex:~ plexserver$ php /Users/plexserver/getplexusers/getplexusers.php sed: 1: ",20p;20q": invalid command code , PHP Notice: Undefined offset: 0 in /Users/plexserver/getplexusers/getplexusers.php on line 62 PHP Warning: file_get_contents(): Filename cannot be empty in /Users/plexserver/getplexusers/getplexusers.php on line 25 PHP Notice: Undefined index: alt in /Users/plexserver/getplexusers/getplexusers.php on line 99

Array
(
    [0] => Array
        (
            [User] => 127.0.0.1
            [Show] => 
            [LastActivity] => 43 years
            [StartTime] => Wednesday 31st of December 1969 06:00:00 PM
            [IP] => 127.0.0.1
            [HostName] => localhost
            [ElapsedSeconds] => 1361948051
        )

)
JohnnyPrimus commented 11 years ago

I see the same issue.

After looking at it for a second I changed the grep query on line three from

shell_exec("grep -nr \"GET /video/:/transcode/segmented/start.m3u8\"

to

shell_exec("grep -nr \"GET /video/:/transcode/universal/start.m3u8\"

and see a bit more relevant data, although I am only seeing one result. There may only be one result in that log file, I'm not sure what its rotation schedule looks like. It still seems to be confused about the time.