Where are the user's cell phone numbers kept in Nagios XI? I'm referring to the mobile number set via a users "Notification Options" -> "Notification Methods".
I have another unrelated program that needs a list of users and cell phone numbers. I'd love to get a dump from Nagios XI and use it for this other program, instead of maintaining two copies of the data.
I briefly looked in the nagios configs in /usr/local/nagios/etc, the mysql and postgress databases. Maybe I missed the table? What is the right table name?
Thanks!
Dump of Users and Mobile numbers
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Dump of Users and Mobile numbers
you can run the following from the shell
Code: Select all
echo "select username,keyvalue as mobile from xi_users,xi_usermeta where xi_users.user_id=xi_usermeta.user_id and keyname='mobile_number';"|psql nagiosxi nagiosxiRe: Dump of Users and Mobile numbers
Thanks! Very helpful.
How about also getting the corresponding Cell Provider email address?
How about also getting the corresponding Cell Provider email address?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Dump of Users and Mobile numbers
Can't easily do that in a single query, but I can show you how to get what the provider is for each username
Then the provider info is stored serialized in postgres
Code: Select all
echo "select username,keyvalue as mobile_provider from xi_users,xi_usermeta where xi_users.user_id=xi_usermeta.user_id and keyname='mobile_provider';"|psql nagiosxi nagiosxiCode: Select all
echo "select value from xi_options where name='mobile_provider_info';"|psql nagiosxi nagiosxiRe: Dump of Users and Mobile numbers
Much appreciated. Thanks.