User Status Plugin

User Status Plugin is a plugin for the Openfire XMPP server to save the user status to the database.

This plugin automatically saves the last status (presence, IP address, logon and logoff time) per user and resource to userStatus table in the Openfire database.

Optionally you can archive user status entries (IP address, logon and logoff time) for a specified time. History entries are stored in the userStatusHistory table. The settings for history archiving can be configured on the “User Status Settings” page that you’ll find on the “Server” tab of the Openfire Admin Console.

The plugin is available at http://maven.reucon.com/projects/public/user-status

According to the project’s Web site, currently this plugin only works with MySQL.

License: GNU General Public License, Version 2.0

Requires >=3.4.1 according to the logs.

The SQL for DB/2 looks like this:

CREATE TABLE userStatusHistory (

historyID BIGINT NOT NULL,

username VARCHAR(64) NOT NULL,

resource VARCHAR(64) NOT NULL,

lastIpAddress CHAR(15) NOT NULL,

lastLoginDate CHAR(15) NOT NULL,

lastLogoffDate CHAR(15) NOT NULL,

PRIMARY KEY(historyID)

);

CREATE TABLE userStatus (

username VARCHAR(64) NOT NULL,

resource VARCHAR(64) NOT NULL,

online INT NOT NULL,

presence CHAR(15),

lastIpAddress CHAR(15) NOT NULL,

lastLoginDate CHAR(15) NOT NULL,

lastLogoffDate CHAR(15),

PRIMARY KEY(username, resource)

);

INSERT INTO jiveVersion (name, version) VALUES (‘user-status’, 0);

is there going to be a MSSQL version of this at all, We have it running on an MSSQL server already and I am currently getting the IP informormation direct from AD and then running a search on the database.

But would like to get a plugin that would do this for us as it is very slow querying AD and then the Jive database.

Exception in thread “pool-8-thread-2” java.lang.AbstractMethodError
at org.jivesoftware.openfire.event.SessionEventDispatcher.dispatchEvent(SessionEve ntDispatcher.java:79)
at org.jivesoftware.openfire.handler.IQAuthHandler.handleIQ(IQAuthHandler.java:176 )
at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:49)
at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:349)
at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:101)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:68)
at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:10 0)
at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:61 )
at org.jivesoftware.openfire.http.HttpSession.sendPendingPackets(HttpSession.java: 460)
at org.jivesoftware.openfire.http.HttpSessionManager$HttpPacketSender.run(HttpSess ionManager.java:318)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

The message appears in the OpenFire window (not in log files) each time a user logins to the server.

Client is JwChat @ http-bind

The same error occures in 3.6.0a and any client

Hi Nikolay,

thanks for reporting this issue. I’ve updated the plugin for Openfire 3.6.0.

You can find the 1.0.3 release at http://maven.reucon.com/public/com/reucon/openfire/plugins/user-status/1.0.3/use r-status-1.0.3.jar

Please rename the jar file to user-status.jar before deploying it to Openfire.

Hope that helps,

Stefan

Works fine!

Thanks a lot!

This works great, thanks. Any chance of getting an option to also log presence changes to the long term history. We have some users that never log out, so the time between log on and loggoff could be quite extensive (days or weeks).

Thanks

-Steffan

1 Like

the LastLoginDate is stated as 1295481626136, how do I convert it to a readable date and time?

The time is stored in the Unix time. This is stored in milliseconds since 1.1.1970.

If you are using Excel to convert the time 1295481626136 into a date you may use:

=DATEVALUE(“1/1/1970”)+A1/1000/60/60/24

You get 20/1/2011 0:00 (if you format the cell as date time)

It seems like the UserStatusHistory has not meaning after the date conversion, anyone know what is the value for?

Hi ,

I am not able to download this plugin .when i browse the follwong url ,

http://maven.reucon.com/public/com/reucon/openfire/plugins/user-status/1.0.3/use r-status-1.0.3.jar

i am getting the following error .

This webpage is not available

The webpage at **http://maven.reucon.com/public/com/reucon/openfire/plugins/user-status/1.0.3/use r-status-1.0.3.jar**might be temporarily down or it may have moved permanently to a new web address.

Error 137 (net::ERR_NAME_RESOLUTION_FAILED): Unknown error.

can you help me to download this plugin .

Hi… can we use this plugin with postgres sql database. If possible then please help me in the same

I can see entries of user login in DB but how can I access those info from XMPP client. I mean some IQ to get that response ?

Hey, is it working with Oracle DB and latest version of openfire??

HI ,

I think this plugin not available now . All the reference link are not working . Can any one help me to find the plugin which will help us to verify the details below .

  1. User login time ?
  2. User logout time ?
  3. User ideal time ?

Hallo.

I 'm also interested in the userstatus plugin. The source code can be found here. However, it doesn’t build, since the maven coordinates point to the non-existent com.reucon.
I have forked Openfire to add it to (src/plugins) and made similar modifications to its pom.xml and to the src/plugins/pom.xml like the monitoring plugin. However, I still get the error:

[ERROR] Failed to execute goal on project user-status: Could not resolve dependencies for project org.igniterealtime.openfire.plugins:user-status:jar:1.1.0-SNAPSHOT: Could not find artifact org.igniterealtime.openfire:openfire:jar:4.2.0-SNAPSHOT in igniterealtime (http://igniterealtime.org/repo/) -> [Help 1]

I cannot upload attachments, (my old account doesn’t work anymore), so I explain my changes below:
src/plugins/pom.xml was modified to add the new module like so:

<module>userstatus</module>

The plugin’s pom.xml was modified like so:

 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <artifactId>plugins</artifactId>
         <groupId>org.igniterealtime.openfire</groupId>
         <version>4.2.0-SNAPSHOT</version>
     </parent>
     <groupId>org.igniterealtime.openfire.plugins</groupId>
     <artifactId>user-status</artifactId>
     <version>1.1.0</version>
     <name>User Status Plugin</name>
     <description>Openfire plugin to save the user status to the database.</description>
     <organization>
         <name>Stefan Reuter</name>
     </organization>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <currentVersion>${project.version}</currentVersion>
     </properties>
     <licenses>
         <license>
             <name>GNU General Public License, Version 2.0</name>
             <url>http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</url>
             <distribution>repo</distribution>
         </license>
     </licenses>
     <scm>
         <connection>scm:git:git://github.com/srt/userstatus.git</connection>
         <developerConnection>scm:git:git://github.com/srt/userstatus.git</developerConnection>
     </scm>
     <issueManagement>
         <system>JIRA</system>
         <url>http://jira.reucon.org/browse/USP</url>
     </issueManagement>
     <dependencies>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>3.8.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
             <version>2.3</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.igniterealtime.openfire</groupId>
             <artifactId>openfire</artifactId>
             <version>4.2.0-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>
     <build>
         <sourceDirectory>src/java</sourceDirectory>
         <plugins>
             <plugin>
                 <artifactId>maven-assembly-plugin</artifactId>
             </plugin>
         </plugins>
     </build>
 </project>

Could you please provide some feedback on what do I miss to make it compile?

Will I be able to push back my changes with a pull request, or more steps are needed?

Thanks.

John.

You may need to do a “mvn install” on the core XmppServer project to get a local SNAPSHOT dependency installed of Openfire in your local maven cache.

Did a mvn clean install on my Openfire clone but the error is the same.

[ERROR] Failed to execute goal on project user-status: Could not resolve dependencies for project org.igniterealtime.openfire.plugins:user-status:jar:1.1.0: Failure to find org.igniterealtime.openfire:openfire:jar:4.2.0-SNAPSHOT in http://igniterealtime.org/repo/ was cached in the local repository, resolution will not be reattempted until the update interval of igniterealtime has elapsed or updates are forced

I checked in my local repo under .m2 that xmppserver.jar is corrected created, but not openfire.jar. What am I missing?