Your comments

Yea, except it is absolutely broken. I just watched a user delete messages when the permission is set to admin. So i guess thanks for putting the UI in but not actually enforcing it (makes total sense... i guess to someone...)

Wonder if bumping after a year of no response is allowed or frowned upon?

It wont use the default settings because all the apps are just web browsers wrapped in the application to appear as native. With that being said, it means the local settings are not even considered let alone used. This would only work as a global admin setting or individual user setting (preferably both) with the way Ryver works.

This is any file that can be opened in the browser, not just XML files. Since the app is basically just a wrapper around a browser window, it acts just like a web browser would. There needs to be some code added to treat every file type (css, js, html, xml, etc) as a download and not an open file.

I am going to bring this up AGAIN because i watched another employee delete a message & there was nothing that could be done.


you saw that? I thought it could have been mis understood. lol thought if i took it out you didnt see it.

and of course now there is zero record of it ever existing except the face i happened to see it. This is such a broken and ridiculous thing to leave in and not take very little time to address over the course of A YEAR!!!!!!!!

Markus, you can use built in commands to display any info you want. I have a cron that runs twice a day and shows me my raid status for all my web servers. It utilizes the mdstat but i have others that use fdisk, uptime, ls, any many more. You can use PHP to dump all the data and then post it to ryver. 


This forum is not really "code" friendly so i am not sure how this will turn out (formatting i am sure will be busted)...


$raidURL = 'https://{YOUR_ORGANIZATION}.ryver.com/application/webhook/{YOUR_KEY}';

$serverList = array('SERVER_1' => 'SERVER_ADDR_1', 
'SERVER_2' => 'SERVER_ADDR_2');

foreach ($serverList as $server => $url)
{
$raw = file_get_contents($url .'/serverStatus.php?cmd=mdstat');
$xml = simplexml_load_string($raw);
$serverStatus = (array) $xml;

$driveResult = display_mdstat($serverStatus['MDSTAT']);

$payLoad .= $server ."\r\n";
$payLoad .= "```\r\n". str_replace('<br>', "\r\n", $driveResult) ."\r\n```";
$payLoad .= "\r\n";
}

$result = postRyverWebhook($raidURL, $payLoad);

function postRyverWebhook($url, $msg)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1");
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'body='. urlencode($msg));
$result = curl_exec($ch);
curl_close($ch);

if ($result === false) 
{
return 'Curl error: ' . curl_error($ch);
}
return $result;
}

function display_mdstat($raw)
{
$raw = (array) $raw;

foreach ($raw as $item => $line)
{
$array[] = $line;
}

for ($x = 0; $x < count($array); $x++)
{
$thisLine = $array[$x];

if (strstr($thisLine, 'active'))
{
$clean .= trim($array[$x]) .' - '. trim($array[$x+1]) .'<br>';
}
}
return $clean;
}


function display_serials($raw)
{
$raw = (array) $raw;
$array = (array) json_decode($raw[0]);

foreach ($array as $index => $obj)
{
if (trim($obj->PARTITION) && trim($obj->SERIAL) && trim($obj->MODEL))
{
$clean .= $obj->PARTITION .' - '. $obj->SERIAL .' ['. $obj->MODEL .']<br>';
}
}
return $clean;
}


function display_uptime($raw)

{
$raw = (array) $raw;

foreach ($raw as $item => $line)
{
$array[] = $line;
}

$clean = $array[0];

return $clean;
}


And in the serverStatus.php file you have the commands



switch($_GET['cmd'])
{
case 'mdstat':
exec("cat /proc/mdstat", $mdstat);
break;

case 'fdisk':
exec("sudo fdisk -l", $fdisk);
break;

case 'uptime':
exec("uptime", $uptime);
break;

case 'lsblk':
exec("sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL", $lsblk);
break;

case 'ls':
exec("ls /dev/sd?", $lsDrives);
break;

default:
exec("cat /proc/mdstat", $mdstat);
exec("sudo fdisk -l", $fdisk);
exec("uptime", $uptime);
exec("sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL", $lsblk);
exec("ls /dev/sd?", $lsDrives);
break;
}


if ($lsDrives)
{
foreach ($lsDrives as $index => $partition)
{
unset($hdparm);
exec("sudo hdparm -I ". $partition ." | grep -e \"Serial Number\" -e \"Model Number\"", $hdparm);
$model = trim(str_replace('Model Number: ', '', $hdparm[0]));
$serial = trim(str_replace('Serial Number: ', '', $hdparm[1]));

if (strlen($model) > 5 && strlen($serial) > 5)
{
$serialNumbers[] = array('PARTITION' => $partition, 'MODEL' => $model, 'SERIAL' => $serial);
}
}
}

$data = array('MDSTAT' => $mdstat, 'FDISK' => $fdisk, 'UPTIME' => $uptime, 'LSBLK' => $lsblk, 'SERIALS' => json_encode($serialNumbers));
$xml = new SimpleXMLElement('<serverStatus />');
to_xml($xml, $data);
print $xml->asXML();

function to_xml(SimpleXMLElement $object, array $data)
{   
    foreach ($data as $key => $value)
    {   
        if (is_array($value))
        {   
            $new_object = $object->addChild($key);
            to_xml($new_object, $value);
        }   
        else
        {
if (is_numeric($key))
{
$key = 'item_'. $key;
}

            $object->addChild($key, $value);
        }   
    }   


So your web user will need SUDO access to run these commands. Quite simple and the possibilities of data you can be posting automatically are pretty much endless. Anyways, just some example code that will hopefully help others who manage servers and want to add some automation in there.

Also, just an FYI as you can see in the image, that error text is so useless. There is absolutely nothing i can do with that information.... I think there is another open request for actually showing failed information for more than just the last one and actually showing the information from a couple months ago...


EDIT: Found it.. Marked "Started" 5 months ago... http://feedback.ryver.com/topics/252-cant-view-failed-webhooks/

This can be closed.

TY for the explanation. Guess i just have one extra task for some reason.

I know this is an old post, but some clarification for future searchers.


Anything older than 4.4 is not even supported anymore. Also anything older than that only contains around 10-15 percent of all android usage. That also means even less would be ryver users and directly impact their business (which is also providing a free service). I can agree with Jeff on this one in not supporting it. As a developer it is extremely difficult to support so many platforms and versions. I honestly wouldn't support 4.* at all and would start rethinking devoting resources to 5.* as it too is 3 or 4 years old and wont be supported much longer considering 8 is in the works.


A simple idea, people should update their phones. It is free to do it!


Fun fact... Everything has an end of life cycle, even Windows XP (should developers still support that too?? Good luck!) :)