# Released a small web app to show cluster status

**URL:** <https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416>\
**Category:** Users/Site Administrators\
**Created:** [January 23, 2019, 3:04am UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416 "2019-01-23T03:04:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![speleolinux](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@speleolinux](https://community.openpbs.org/u/speleolinux)\
**Post date:** [January 23, 2019, 3:04am UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/1 "2019-01-23T03:04:13Z")

</div>

Hi all

I have released as open source a small web application to show the nodes, queues and jobs running on a cluster which uses PBS Pro. This is useful for administrators to quickly see the status of the nodes and how busy they are, to check how full each queue is and to see what jobs are running and queued. It’s also useful for users to see this information as well.

You can see our working example here: [https://hpc.research.uts.edu.au/status/](https://hpc.research.uts.edu.au/status/)  
Here is a screenshot:

 ![Screenshot of PBSWeb](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/34d13a102e3b0695f2c9bf59dd331a59eab70613.png)

The source code is here: [https://github.com/UTS-eResearch/pbsweb](https://github.com/UTS-eResearch/pbsweb)

Hopefully some of you may find this useful. Suggestions and improvements are welcome.

Best Regards  
Mike Lake  
eResearch, University of Technology Sydney

---

<div class="post-metadata">

**Author:** ![mkaro](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/mkaro/32/85_2.png) [@mkaro](https://community.openpbs.org/u/mkaro)\
**Post date:** [January 23, 2019, 7:03pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/2 "2019-01-23T19:03:15Z")

</div>

Nicely done! 🎉

Thank you very much for supporting the PBS Pro community.

Mike

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [January 23, 2019, 8:56pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/3 "2019-01-23T20:56:36Z")

</div>

+1  
Much appreciate it ! Much helpful, certainly will invoke wide spread usage !  
Thank you 👍

Something like this would be good, color coding reflects job distribution.

 ![pbs_cluster_status](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/a94304a07f8a28684dbad4b403f721abd0ee8bf9.png)

---

<div class="post-metadata">

**Author:** ![daniel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/daniel/32/630_2.png) [@daniel](https://community.openpbs.org/u/daniel)\
**Post date:** [August 28, 2019, 12:00pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/4 "2019-08-28T12:00:09Z")

</div>

Hello @adarsh, how are you doing?

Which software (pbs cluster status - image that you attached) are you using to monitor your PBS workload?

Thanks

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [August 28, 2019, 12:15pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/5 "2019-08-28T12:15:50Z")

</div>

Hi @daniel, i am doing good, thank you. How are you? I have written a python script that outputs the above html page. This python script runs as a cronjob updating the page every minute or so.

---

<div class="post-metadata">

**Author:** ![daniel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/daniel/32/630_2.png) [@daniel](https://community.openpbs.org/u/daniel)\
**Post date:** [August 28, 2019, 12:56pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/6 "2019-08-28T12:56:07Z")

</div>

@adarsh  
I’am doing well tahnks.

It is available for download or can you share it?

Regards

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [August 28, 2019, 1:28pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/7 "2019-08-28T13:28:58Z")

</div>

I can share the script, please let me first check & sanitise it before sharing. Also, please share it back to the community if you extend it.

---

<div class="post-metadata">

**Author:** ![speleolinux](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@speleolinux](https://community.openpbs.org/u/speleolinux)\
**Post date:** [June 14, 2022, 11:24pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/8 "2022-06-14T23:24:16Z")

</div>

Hi Adarsh

Quite a few users would probably like to use your Python script. We look forward to it if you can release it under an open source license. That screen shot of the page it generates looks very useful. A simple python script run by cron would be easier to install than my Python WSGI app for some users.

Mike

---

<div class="post-metadata">

**Author:** ![speleolinux](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@speleolinux](https://community.openpbs.org/u/speleolinux)\
**Post date:** [June 14, 2022, 11:38pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/9 "2022-06-14T23:38:48Z")

</div>

Hi all

I have updated my PBSweb app that displays in real time the PBS stats for your HPC. The code is at [GitHub - UTS-eResearch/pbsweb: Web interface to show nodes, queues and jobs on a High Performance Compute Cluster using PBS Pro](https://github.com/UTS-eResearch/pbsweb)

This release is version 2.0.0 which now has a script to ease the installation, better documentation, bug fixes, and now most importantly it works with Python 3.8 instead of Python 2.7. See the Change Log and the Install instructions. For other details read the top of this post.

Regards  
Mike Lake

---

<div class="post-metadata">

**Author:** ![vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@vinay](https://community.openpbs.org/u/vinay)\
**Post date:** [June 21, 2022, 11:21am UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/10 "2022-06-21T11:21:42Z")

</div>

> [@speleolinux](#):
>
> Python

hi mike,

I am getting below error. -

./swig\_compile\_pbs.sh

/usr/bin/ld: cannot find -lsec

collect2: error: ld returned 1 exit status

chmod: cannot access ‘\_pbs.so’: No such file or directory

---

<div class="post-metadata">

**Author:** ![speleolinux](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@speleolinux](https://community.openpbs.org/u/speleolinux)\
**Post date:** [June 21, 2022, 11:56pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/11 "2022-06-21T23:56:46Z")

</div>

Hi Vinay

On my \_pbs.so created from swig\_compile\_pbs.sh I can check where this comes from:  
$ ldd \_pbs.so  
… snipped  
libpbs.so.0 =\> /opt/pbs/lib/libpbs.so.0 (0x00007ff94c5f8000)  
libssl.so.1.1 =\> /lib64/libssl.so.1.1 (0x00007ff94bc5b000)  
libsec.so.0 =\> /opt/pbs/lib/libsec.so.0 (0x00007ff94ba58000)  
… snipped  
So in my system with PBSPro it comes from /opt/pbs/lib/libsec.so.0 which is from the pbspro-client package. Perhaps OpenPBS does not have this.  
Googling says it provides “Functions in this library provide comparison and manipulation of File Access Control Lists.”

Edit the swig compile and remove that link requirement. I see that on my system it still makes \_pbs.so so I willl need to lookup why I had it there.

Mike

---

<div class="post-metadata">

**Author:** ![vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@vinay](https://community.openpbs.org/u/vinay)\
**Post date:** [June 28, 2022, 4:19am UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/12 "2022-06-28T04:19:46Z")

</div>

> [@speleolinux](#):
>
> So in my system with PBSPro it comes from /opt/pbs/lib/libsec.so.0 which is from the pbspro-client package. Perhaps OpenPBS does not have this.

Hi mike,  
Sorry to bother you. I did that and wen ahead, **install\_pbsweb.sh** … but then this gives error pbs.py and pbs.so not found. so i commented those also.

now it has permission issues.

Although the script is convinient, but i guess lot of setups will have different architecture.

So is there someway, i can get the python app, which i can just copy paste modify the wsgi file and host it as per my web server preference suppose apache.

---

<div class="post-metadata">

**Author:** ![speleolinux](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@speleolinux](https://community.openpbs.org/u/speleolinux)\
**Post date:** [June 28, 2022, 6:42am UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/13 "2022-06-28T06:42:23Z")

</div>

Hi Vinay  
Did you copy pbs\_ifl.h to the pbsweb directory?  
After removing the -lsec did the swig script create the three files: pbs.py, pbs\_wrap.c and \_pbs.so ?  
What of those three files did it create?  
If it did not create \_pbs.so that issue needs to be solved as the application needs that file to work.  
Mike

---

<div class="post-metadata">

**Author:** ![vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@vinay](https://community.openpbs.org/u/vinay)\
**Post date:** [June 28, 2022, 12:45pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/14 "2022-06-28T12:45:48Z")

</div>

Hi Mike,  
I have copied pbs\_ifl.h in the pbsweb directory.

but I am stuck with swig\_compile\_pbs.sh file.

![Screenshot 2022-06-28 at 6.14.25 PM](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/222e873024ff02e0a6905b6b0b4be355ba2fdc92.png)

Also I am testing it now with pbspro 19.1.3. What should i comment in swig compile file to avoid it.

---

<div class="post-metadata">

**Author:** ![speleolinux](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@speleolinux](https://community.openpbs.org/u/speleolinux)\
**Post date:** [June 28, 2022, 1:36pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/15 "2022-06-28T13:36:28Z")

</div>

Hi  
In the swig script you will see there is a compiling step and a linking step.  
The compiling is just this one line:  
gcc -c -shared -fpic -I$PYTHON\_INCL -I$PBS\_EXEC/include pbs\_wrap.c  
After that line add “exit” into the script so it will stop at this point. Run the script.  
This should create three files pbs\_wrap.c pbs\_wrap.o pbs.py  
Do you get these 3 files being created? What is the output of the swig script when it runs?  
There should be no output if this step went OK.  
Then we will move onto the linking step later on.  
Mike

---

<div class="post-metadata">

**Author:** ![vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@vinay](https://community.openpbs.org/u/vinay)\
**Post date:** [June 28, 2022, 4:00pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/16 "2022-06-28T16:00:49Z")

</div>

Hi Mike,  
I was able to go further. Yes those 3 files were created. Now after starting the application when I try to access http://ip\_address/statuspbs it gives - Internal server error.

Below is the uwsgi.log

![Screenshot 2022-06-28 at 9.27.56 PM](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/f9a59e41f81a2734fb3b00524d2fdefab61fdee1.png)

 ![Screenshot 2022-06-28 at 9.27.14 PM](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/9624f819d56e3c565c4dfdf8d8a1483df616bd2b.png)

---

<div class="post-metadata">

**Author:** ![speleolinux](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@speleolinux](https://community.openpbs.org/u/speleolinux)\
**Post date:** [June 28, 2022, 11:54pm UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/17 "2022-06-28T23:54:25Z")

</div>

Hi Vinay  
Next step is to remove the “exit” you added and run swig again. We know that everything is fine (probably) up to this step. The linking step should create \_pbs.so. That’s what the option -o means, i.e. output \_pbs.so by linking together the preceeding files.  
Also check that there is a $PBS\_EXEC/lib/libpbs.so  
Mike

---

<div class="post-metadata">

**Author:** ![vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@vinay](https://community.openpbs.org/u/vinay)\
**Post date:** [June 29, 2022, 3:04am UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/18 "2022-06-29T03:04:59Z")

</div>

Hi Mike,  
So after removing exit from swig script. It gave the same error -  
as earlier. So I removed the -lsec option from third line. and then executed it again, and it ran fine. created the file \_pbs.so

gcc -shared -fpic -L/opt/pbs/lib   
$PBS\_EXEC/lib/libpbs.so pbs\_wrap.o   
-lpthread -lcrypto -lssl   
-o \_pbs.so

* * *

I wen ahead with other steps after this. But still opening the [http://localaddress/statuspbs](http://localaddress/statuspbs) gives “Internal Server error”

uwsgi log file gives below output -

**— no python application found, check your startup logs for errors —**

[pid: 1498|app: -1|req: -1/7] 10.101.202.77 () {42 vars in 783 bytes} [Wed Jun 29 08:28:07 2022] GET /statuspbs/ =\> generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

* * *

But the uwsgi service is running -

 ![Screenshot 2022-06-29 at 8.23.17 AM](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/98fd482a8ba66f42667178dd274c8d7a3a656fc2.png)

What conf should i check.

---

<div class="post-metadata">

**Author:** ![speleolinux](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@speleolinux](https://community.openpbs.org/u/speleolinux)\
**Post date:** [June 29, 2022, 4:02am UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/19 "2022-06-29T04:02:39Z")

</div>

Hi Vinay  
Check in the pbsweb.ini that the paths there are all present.  
Check your webserver conf setup and its logs.  
Googling has a lot of stuff with that error message. I find that Python WSGI is not easy!  
I also have a minimal Python WSGI app that is useful for testing that just prints some text. Don’t seem though to be able to upload or attach them here.  
Mike

---

<div class="post-metadata">

**Author:** ![vinay](https://avatars.discourse-cdn.com/v4/letter/v/6a8cbe/32.png) [@vinay](https://community.openpbs.org/u/vinay)\
**Post date:** [June 29, 2022, 4:08am UTC](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416/20 "2022-06-29T04:08:54Z")

</div>

No Problem mike. Ill udpate you soon.

[Next page](https://community.openpbs.org/t/released-a-small-web-app-to-show-cluster-status/1416.md?page=2)
