On 4/20/07, ramakula <[EMAIL PROTECTED]> wrote:
chet wrote: > On 4/19/07, ramakula <[EMAIL PROTECTED]> wrote: > > > Hi All, > > > > I need Nagios plugin for to check service statuses of linux system. > > > > Please let me know where do I get this plugin? > > > > I done like with shell script. But not working with nagios monitoring system. > > > > > > Code: > > #!/bin/sh > > host="$1" > > service="$2" > > t=`/etc/init.d/$service status` > > if echo "$t" |grep -q running; then > > echo "OK - $service service is running." > > exit 0 > > else > > echo "Critical - $service service is stopped." > > exit 2 > > fi > > > > > > > > when Nagios executing this shell script not executing `/etc/init.d/$service status` command. nothing storing in $t. then result always showing "Critical - $service service is stopped. > > > > But which working fine when I am executing this script from terminal as root user. > > > > whet is the problem with this? > > How do I proceed? > > > > Ramesh, > > Have you tried running this as the zenoss user? Maybe the particular > service you're trying to get the status of requires some kind of root > privilege to get the status. I tested your script on my services and > got good results from it. > > What does the command template that invokes this plugin look like? How to give privilages to nagios monitoring tool to access that commands?
Are you talking about Nagios or Zenoss? -- Chet Luther [EMAIL PROTECTED] _______________________________________________ zenoss-users mailing list [email protected] http://lists.zenoss.org/mailman/listinfo/zenoss-users
