Contribution: Send Nagios alert upon ticket creation

I thought I’d pass along a contribution I just added to the RT Wiki
site. I’ve configured a custom scrip that will set off a Nagios alert
if a ticket is created in a particular queue. We setup a couple queues
for that are intended to be “alert” queues that users can e-mail if
something serious has happened. If a ticket is created in this queue,
it will trigger a Nagios alert and will start paging the appropriate
personnel. Instructions can be found here:

http://wiki.bestpractical.com/index.cgi?SendNagiosAlert

Enjoy,

-=Kevin=-

I have created a helpdesk_user2 with phpmyadmin on a remote MySQL 4.1.12
server (which is what I have to use).

I issue this command:

/opt/rt3/sbin/rt-setup-database --action init --dba helpdesk_user2
–prompt-for-dba-password

I get this:

[root@silicon sbin]# /opt/rt3/sbin/rt-setup-database --action init --dba
helpdesk_user2 --prompt-for-dba-password
In order to create a new database and grant RT access to that database,
this script needs to connect to your mysql instance on
internal.mysql.org as helpdesk_user2.
Please specify that user’s database password below. If the user has no
database
password, just press return.

Password: Now creating a database for RT.
Creating mysql database helpdesk2.
Now populating database schema.
Creating database schema.
schema sucessfully inserted
Now inserting database ACLs
DBD::mysql::st execute failed: Access denied for user
’helpdesk_user2’@‘silicon.sys.org’ to database ‘helpdesk2’
at /opt/rt3/sbin/rt-setup-database line 337.
Problem with statement:
GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE ON helpdesk2.* TO
helpdesk_user2@‘internal.mysql.org’ IDENTIFIED BY ‘db_password’;
Access denied for user ‘helpdesk_user2’@‘silicon.sys.org’ to database
’helpdesk2’ at /opt/rt3/sbin/rt-setup-database line 338.

Does this block in RT_SiteConfig have anything to do with the problems I
am having?

{{{ Database Configuration

Database driver beeing used. Case matters

Valid types are “mysql”, “Oracle” and “Pg”

Set($DatabaseType , ‘mysql’);

The domain name of your database server

If you’re running mysql and it’s on localhost,

leave it blank for enhanced performance

Set($DatabaseHost , ‘internal.mysql.org’);
Set($DatabaseRTHost , ‘internal.mysql.org’);

The port that your database server is running on. Ignored unless it’s

a positive integer. It’s usually safe to leave this blank

Set($DatabasePort , ‘’);

#The name of the database user (inside the database)
Set($DatabaseUser , ‘helpdesk_user2’);

Password the DatabaseUser should use to access the database

Set($DatabasePassword , ‘db_password’);

The name of the RT’s database on your database server

Set($DatabaseName , ‘helpdesk2’);

What should this:
Set($DatabaseHost , ‘internal.mysql.org’);
Set($DatabaseRTHost , ‘internal.mysql.org’);
be set to?

I have read some documentation on RT’s site and it has said that you
don’t have to add a db_user. Is this true? I don’t think that would
work.

Tim

Tim Suter wrote:

DBD::mysql::st execute failed: Access denied for user
’helpdesk_user2’@‘silicon.sys.org’ to database ‘helpdesk2’
at /opt/rt3/sbin/rt-setup-database line 337.
Problem with statement:
GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE ON helpdesk2.* TO
helpdesk_user2@‘internal.mysql.org’ IDENTIFIED BY ‘db_password’;
Access denied for user ‘helpdesk_user2’@‘silicon.sys.org’ to database
’helpdesk2’ at /opt/rt3/sbin/rt-setup-database line 338.
Does this block in RT_SiteConfig have anything to do with the problems I
am having?

Looks like your only real problem is that the helpdesk2 user doesn’t
have the permissions it needs to modify the helpdesk2 table permissions.