Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Server Status to the interface #49

Closed
georg90 opened this issue Aug 6, 2014 · 6 comments
Closed

Add Server Status to the interface #49

georg90 opened this issue Aug 6, 2014 · 6 comments

Comments

@georg90
Copy link

georg90 commented Aug 6, 2014

Hi!
Great piece of work!! It's working out of the box, has a very nice and usable interface.
I'm hosting different services on my pi, so I wonder if it's possible to add a small html page to check certain ports if the service is running?

I have this in php already working:

$arr = array(
    array('SSH Server', 2299, $serverip),
    array('Proxy Server', 80, $serverip),
   array('DNS Server', 53, $serverip),
);

foreach($arr as $c) {
    if(@fsockopen($c[2], $c[1], $errno, $errstr, 4))  {
        $img = "up.png";
    } else {
        $img = "down.png";
    }

    echo '<tr>
        <td bgcolor="#EAEAEA">'.$c[0].'</td>
        <td align="center" bgcolor="#FFFFFF"><img src="'. $img .'" border="0" width="14" height="14" alt="" /></td>
        <td bgcolor="#EAEAEA" align="center">'.$c[1].'</td>
    </tr>';
    flush();
}

Where can I implement this in your script? also possibly use this nicer one:
https://github.com/mojeda/ServerStatus

@diederikdehaas
Copy link

service ssh status will return it's status which you can then apply a regex to to get the info you need.

@georg90
Copy link
Author

georg90 commented Aug 6, 2014

I'm aware of ways to get the information, my question was more regarding how to implement the "result" in the rpi monitor application? :)

@XavierBerger
Copy link
Owner

Hello,
I think thant the feature you miss is the possibility to create a ’label’ with a specific color (background and/orground that will alow you to reflect a status. This idea as been proposed in anpther issue. I do plan to integrate it since the idea is good and I’ve a feedback showing a need.
Until this is released, you can add javascript into the configuration files which will do the job. This is alittle bit tricky but this is the strenght of RPi-Monitor where everything is configurable.

Xavier

(Sent from my tablet.)

@georg90
Copy link
Author

georg90 commented Aug 7, 2014

can you give me a simple example on where to add the code?

cheers!

@XavierBerger
Copy link
Owner

Hello, the best way to understand how to configure RPi-Monitor is to have a look to the defferent example detailled in my blog. Remember that the definition of web item are in javascript. That could help during customization.

Xavier
Sent from my tablet.

@XavierBerger
Copy link
Owner

New function added in main branch: Label.
This feature will be part of the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants