Jump to content

Pulseway + Emby Server Service Monitoring


ubelong2matt
Go to solution Solved by ubelong2matt,

Recommended Posts

ubelong2matt

I have been using Pulseway for all of my servers and my computers for a while.  If you're familiar with it then check it out as it's a very good program for monitoring and manipulating your computers/servers from anywhere.  It has the ability to monitor services such as SSH, FTP, etc.  The issue is that I'm not terribly strong with Linux (Ubuntu Server 14.04) and knowing boot types and all that jive is something I've read about but I'm not easily able to identify based on service information.  Here's the sample config file that they provide for Linux.  The specific section is regarding services:

<?xml version="1.0" encoding="utf-8"?>
<config xmlns="http://www.pulseway.com/linuxconfig">
  <!--Pulseway Linux Monitoring Agent - pulseway.com -->

  <!--Monitored Services-->
  <MonitoredServices>
    <!--Service
      - Name: service name
      - DisplayName: friendly name used for display
      - IsDaemon: 'true' if the monitored service is a daemon and 'false' if the monitored service is a process
      - DaemonType: system management daemon type: NONE, SYSVINIT, UPSTART or SYSTEMD
      - Path: path of the monitored service (this is used when the monitored service is a process)
      - StartParameters: parameters used to start the monitored service (this is used when the monitored service is a process)
      - CanBeStopped: 'true' or 'false'-->
    <Service Name="cups" DisplayName="CUPS Service" IsDaemon="true" DaemonType="SYSVINIT" Path="" StartParameters="" CanBeStopped="true" Enabled="false" />
    <Service Name="ntpd" DisplayName="NTPD Process" IsDaemon="false" DaemonType="NONE" Path="/usr/sbin/ntpd" StartParameters="-p /var/run/ntp/ntpd.pid -g -u ntp:ntp -i /var/lib/ntp -c /etc/ntp.conf" CanBeStopped="true" Enabled="false" />
    <Service Name="ssh" DisplayName="SSH Daemon" IsDaemon="true" DaemonType="UPSTART" Path="" StartParameters="" CanBeStopped="true" Enabled="false" />
    <Service Name="SuSEfirewall2.service" DisplayName="SuSE Firewall Service" IsDaemon="true" DaemonType="SYSTEMD" Path="" StartParameters="" CanBeStopped="true" Enabled="false" />
  </MonitoredServices>

The question I have is what to provide for the various fields (correct anything that I've provided if necessary):

  • Name="emby-server"
  • DisplayName="Emby"
  • IsDaemon
  • DaemonType
  • Path
  • StartParameters
  • CanBeStopped="true"
  • Enabled="true"

I've tried the IsDaemon as true and false and varying DaemonTypes.  I've checked online for what each type means to try to match it but nothing seems to work.  Emby's service goes down, which normally would send me an alert via e-mail, and I get no notification on it.

 

Anyone who's successfully gotten Pulseway to monitor the emby-server service or know what the missing fields would be?  Any help would be greatly appreciated!

 

Thanks,

Matt

Link to comment
Share on other sites

anderbytes

Maybe you're not considering something: Emby is not a binary (executable), instead it runs on top of Mono (app that runs .NET inside Linux).

 

So you have to monitor Mono... I guess

  • Like 1
Link to comment
Share on other sites

ubelong2matt

Thanks for the reply, anderbytes.  However, when I type...

service --status-all

...I do get a line for emby-server which is either + or - depending on status.  If the Pulseway Service Monitoring is monitoring a service then I would assume it would accept emby-server as a service, would it not?  Sometimes I hate Linux for it's complexities.  When I check the service list I do not see mono so I am not sure this will work with it.  I'll try a few things and see.  I did notice that even though Emby was running, I got a notification from Pulseway that it was not.

Link to comment
Share on other sites

anderbytes

Try typing "top" to see the running processes.

 

The one line that has "mono" and "MediaBrowser" in it ... it's Emby. I hope it has something there to help you.

 

or else type "ps ax | grep mono"

  • Like 1
Link to comment
Share on other sites

ubelong2matt

I see it now.  I will try a few things to see if I can get it to work with this information and let you know.  Appreciate your time, anderbytes.

Link to comment
Share on other sites

Shrom

Why did you not monitor it using the URL ? IF the URL not respondig then Emby is down.

 

Indeed if you can't log in into the App (Web, Mobile(who use the URL..)) you can't use it so...

Edited by Shrom
Link to comment
Share on other sites

ubelong2matt

Shrom, thanks for the reply.  I'm not entirely sure I understand your reply, however.  Are you insisting that I manually attempt to access the URL as a way to know if the site is up?  What Pulseway does is give you the ability to manage your computer or server by providing, impart, notifications ranging from users logging in/out, programs being installed/uninstalled, and services stopping.  Managing a server means finding ways to monitor desired aspects of that server and be alerted to potential problems.  That is what the service monitoring is in Pulseway and what I'm trying to do for Emby.

 

If I am misunderstanding your reply then please let me know.

Link to comment
Share on other sites

Shrom

I 'm just telling you that if Emby is up, the web site and the webApp are up to, so if you want to monitor it, check if the URL is available if yes, then emby is up if not just run emby-server restart ;)

 

Does pulseway can check if a website is up or not ? 

Link to comment
Share on other sites

ubelong2matt

Shrom, I think you may be missing the point of having a monitor for a server (any server, not just the one Emby is running on).  The idea is that you are not monitoring the server yourself but a program is.  It looks for, in regular intervals, the status of varying items that you configure.  When one of those items trigger a notification is sent to you, or another server admin, to investigate.  Pulseway is one such program.  My intention was to have a hands-off monitor of the emby-server "service" to detect when something may have killed the process.

 

Pulseway does have a way to check if a port is closed which I think may be what I want.  However, under my free service I have a limited number of notifications per day and everytime I change the config.xml file it triggers a notification that the server is online.  I have hit that notification limit.  I will have to table my testing of this today (I don't have the $80 a year for the 5-computers I currently monitor to get the yearly subscription) and resume tomorrow by killing the process, seeing if it closes the port, and if it triggers the notification for it.

 

Thanks for your reply.

Link to comment
Share on other sites

ubelong2matt

I think the port one is going to work.  I just discovered, as I don't look at the config.xml file every day, that there's a section for a SysLog, which I have a watcher running on my desktop computer for my router and servers.  I stopped emby-server from running and after a minute I received a notification in the SysLog that the port was closed.  Of course, it keeps telling me it every 10 seconds but, ya know, one battle at a time.  I will have to confirm it sends the e-mail notification correctly after it rolls my notification limit.  If it keeps spamming me like it's spamming the SysLog then this is not going to be acceptable.

 

For those who want the same thing, here is the section I changed in the config.xml file (near the bottom):

<!--Ports-->
                <MonitoredPorts>
                        <!--Port
        - Type: TCP or UDP
        - Number: port number
        - Name: port name
        - Address: computer name or IP address (for UDP only localhost or 127.0.0.1 are valid)-->
                        <Port Type="TCP" Number="80" Name="Google (port 80)" Address="www.google.com" Enabled="false"/>
                        <Port Type="TCP" Number="443" Name="Google (port 443)" Address="www.google.com" Enabled="false"/>
                        <Port Type="UDP" Number="53" Name="DNS" Address="127.0.0.1" Enabled="false"/>
                        <Port Type="TCP" Number="8096" Name="Emby (8096)" Address="<MYADDRESS>" Enabled="true"/>
                </MonitoredPorts>

And also:

 <Notifications>
                <!--Send a notification when the computer is offline-->
                <WhenOffline Priority="0" Enabled="true"/>
                <!--Send a notification when the computer is online-->
                <OnOnline Priority="2" Enabled="true"/>
                <!--Send a notification when the computer is shutting down-->
                <OnShutdown Priority="0" Enabled="true"/>
                <!--Send a notification when a user logs in-->
                <UserLogsIn Priority="2" Enabled="false"/>
                <!--Send a notification when a user logs out-->
                <UserLogsOut Priority="2" Enabled="false"/>
                <!--Send a notification when the available memory is below a certain percentage (between 10 and 90)-->
                <MemoryLow Priority="1" Percentage="10" Enabled="true"/>
                <!--Send a notification when the CPU usage is above a certain percentage (between 10 and 90) for a number of minutes (between 1 and 120)-->
                <HighCpuUsage Priority="1" Percentage="90" Minutes="10" Enabled="true"/>
                <!--Send a notification when the CPU usage is below a certain percentage (between 10 and 90) for a number of minutes (between 1 and 120)-->
                <LowCpuUsage Priority="2" Percentage="10" Minutes="5" Enabled="false"/>
                <!--Send a notification when a port is closed for a number of minutes (between 1 and 120)-->
                <PortClosed Priority="0" Minutes="1" Enabled="true"/>
                <!--Send a notification when a service has stopped for a number of minutes (between 1 and 120)-->
                <ServiceStopped Priority="0" Minutes="1" Enabled="true"/>

Edited by ubelong2matt
Link to comment
Share on other sites

  • Solution
ubelong2matt

W00T!  I figured it out using the service.  Thanks to the command...

ps ax | grep mono

...from anderbytes I was able to see the full path/process/whatever for Emby.  I saw what type of daemon it was, also.  I have done a couple of tests already but here's the line that makes it successfully find and report if the service is offline.  Hope this helps anyone using Pulseway to monitor their Emby server!

<Service Name="emby-server" DisplayName="Emby" IsDaemon="true" DaemonType="UPSTART" Path="/usr/bin/mono-sgen" StartParameters="--optimize=all /usr/lib/emby-server/bin/MediaBrowser.Server.Mono.exe -programdata /var/lib/emby-server -restartpath /usr/lib/emby-server/restart.sh" CanBeStopped="true" Enabled="true"/>

Thanks again for all the replies and help to get this working!  I'm excited!!

Edited by ubelong2matt
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...