Service keeps disappearing from .cfg file and other questions (newbie alert!)
Matty Sarro
msarro at gmail.com
Wed Jun 8 15:18:27 CEST 2011
Hey everyone,
First, I'm new, so please be gentle :)
I have made some recent modifications to our nagios3 files. In
resource.cfg I added the following macros: $db_name$, $db_user_name$,
and $db_user_pass$. These seem to be ok.
I added a service like this:
define service {
hostgroup_name mysql-servers
service_description Mysql FSRW
check_command check_mysql_FSRW
use generic-service
notification_interval 0
}
And finally I added a command like this:
define command {
command_name check_mysql_FSRW
command_line $USER1$/check_mysql_query -q "SELECT COUNT(*) FROM
entry WHERE period<DATE_SUB(now(),INTERVAL 2 DAY) AND status_code<2
AND retries=0 AND type=0" -w0:0 -c10 -H $HOSTADDRESS$ -P 3306 -d
$db_name$ -u $db_user_name$ -p $db_user_pass$
}
When I have nagios validate everything, it gives no errors. I then
restart nagios for the config to take effect, and it comes up. In the
event log I see some issues with the service (it appears to be trying
to connect to the mysql servers as user nagios, not the specified
user). When I then log back into the server and look at my
services.cfg file, and my commands.cfg file, the entries I added to
both of them have been removed - like they were never there.
So, I guess I have a few questions.
First, are those entries in the resource.cfg file ok? Does nagios
support the underscores and longer names? Its easier to understand at
a glance than $USER3$ $USER4$ and $USER5$.
Second, does the command_line look ok? I'm trying to figure out why it
isn't using the username and password I'm passing to it.
Finally, why do the command and service keep disappearing out of my
config file? It's making it a pain to troubleshoot.
Any suggestions or advice would be greatly appreciated.
-Matty
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list