= QCG-Notification Configuration Examples = == GSI Authentication == === Configuration of the service to use GSI Authentication === * Organize credential files for the QCG-Notification service, i.e. cert and key in pem format. The files should be owned by the qcg-ntf user and have appropriate permissions. {{{ #!div style="font-size: 90%" {{{#!sh # tree -pug /etc/qcg/qcg-ntf/certs /etc/qcg/qcg-ntf/certs |-- [-rw-r--r-- qcg-ntf qcg-dev ] hostcert.pem `-- [-r-------- qcg-ntf qcg-dev ] hostkey.pem }}} }}} * Edit the QCG-Notification configuration file and configure the '''sm:atc_transport_gsi.service''' authentication module. Set the '''X509CertFile''' and '''X509KeyFile''' to point to the respective credential files. The example configuration file may look as follows: {{{ #!div style="font-size: 90%" {{{#!sh /usr/lib64/qcg-core/modules /usr/lib64/qcg-ntf/modules /var/log/qcg/qcg-ntf/qcg-ntfd.log INFO grass1.man.poznan.pl 19001 true /etc/qcg/qcg-ntf/certs/hostcert.pem /etc/qcg/qcg-ntf/certs/hostkey.pem true /etc/qcg/qcg-ntf/topicns true qcg-ntf qcg-ntf some_password false }}} }}} === Validation === * Install the client tool for QCG-Notification: {{{ #!div style="font-size: 90%" {{{#!sh # yum install qcg-ntf-client }}} }}} * Setup the client gsi authentication module by editing the qcg-ntf-client configuration file (by default /etc/qcg/qcg-ntf/qcg-ntf-client.xml). Employ the '''sm:atc_transport_gsi.client''' module. {{{ #!div style="font-size: 90%" {{{#!sh /usr/lib64/qcg-core/modules/ /usr/lib64/qcg-ntf/modules/ httpg://grass1.man.poznan.pl:19001 true }}} }}} * Generate GSI proxy (as a regular user): {{{ #!div style="font-size: 90%" {{{#!sh $ grid-proxy-init Your identity: /C=PL/O=GRID/O=PSNC/CN=Bartosz Bosak Enter GRID pass phrase for this identity: Creating proxy ............................................. Done Your proxy is valid until: Thu Aug 1 23:20:35 2013 }}} }}} * Try to create a sample subscription: {{{ #!div style="font-size: 90%" {{{#!sh $ qcg-ntf-client -u httpg://grass1.man.poznan.pl:19001 -S "cons=http://localhost:2233 top=http://schemas.qoscosgrid.org/ntf/2011/04/sample/myhousetopics;//*;Full" Subscribe details: >>> provider: 'httpg://grass1.man.poznan.pl:19001' >>> consRef: 'http://localhost:2233' >>> topicNamespace: 'http://schemas.qoscosgrid.org/ntf/2011/04/sample/myhousetopics' >>> topic: '//*' >>> dialect: 'http://docs.oasis-open.org/wsn/t-1/TopicExpression/Full' >>> period: '' >>> xslt: no Subscribed, subRef: '272872857' }}} }}} * Delete the subsription: {{{ #!div style="font-size: 90%" {{{#!sh $ qcg-ntf-client -u httpg://grass1.man.poznan.pl:19001 -U "id=272872857" Unsubscribe details: >>> provider: 'httpg://grass1.man.poznan.pl:19001' >>> subRef: '272872857' Unsubscribed: '272872857' }}} }}} == Publisher Modules == === XMPP Publisher module configuration === If needed, the module for publishing notifications via XMPP protocol may be installed and enabled in the service's configuration. To install the plugin invoke: {{{ #!div style="font-size: 90%" {{{ yum install qcg-ntf-xmpp-publisher-plugin }}} }}} The relevant part of QCG-Notification configuration file should be uncommented and adjusted to the real situation. For instance, the integration with the PL-Grid XMPP server, assuming that the XMPP account equals 'someaccount' and password is 'somepass', requires the following settings: {{{ #!div style="font-size: 90%" {{{#!xml someaccount@plgrid.pl/qcg-ntf somepass TLS 7B55E421B023D4358BD9CE29F091D91C }}} }}} === SMTP Publisher module configuration === Sending notifications through e-mails is possible with QCG-Notification SMTP publisher module. To install the module use: {{{ #!div style="font-size: 90%" {{{ yum install qcg-ntf-smtp-publisher-plugin }}} }}} The SMTP module can be enabled in the QCG-Notification configuration file by uncommenting and adjusting the relevant 'Module' element. The sample XML fragment presented below is sufficient to distribute e-mails via the locally running SMTP server (eg. Postfix). {{{ #!div style="font-size: 90%" {{{#!xml smtp://localhost:25 }}} }}}