Shell script
Moderators: Developers, Moderators
-
- Cacti User
- Posts: 137
- Joined: Mon Feb 11, 2008 3:46 am
Shell script
I have created one simple shell script as follows,
-------------------------
process.sh
ps -ef
-------------------------
I configure the same script(process.sh) in cacti by using DataInputMethod and created other stuffs DataTemplate,GraphTemplate.
The output of the process(process -ef) i would like to monitor in the graph... Any one could you please confirm whether i am doing correct...
-------------------------
process.sh
ps -ef
-------------------------
I configure the same script(process.sh) in cacti by using DataInputMethod and created other stuffs DataTemplate,GraphTemplate.
The output of the process(process -ef) i would like to monitor in the graph... Any one could you please confirm whether i am doing correct...
- Attachments
-
- DataInputMethod.PNG (64.13 KiB) Viewed 6924 times
-
- Cacti User
- Posts: 137
- Joined: Mon Feb 11, 2008 3:46 am
Apache mod_status
Thanks for your reply. Its very usefull for me... Do u have any idea how to find the NumberOfThreads... from apche.. << mod_status >> ?
-
- Cacti User
- Posts: 137
- Joined: Mon Feb 11, 2008 3:46 am
Shell script not executed by poller.shp
I have configured the shell script(NoOfThread.sh) in DataInputMethod. Its just has the content of printf statement such as
----NoOfThread.sh start ----------
#!/bin/sh
printf '10'
printf '10'
printf '10'
printf '10'
printf '10' >> shellScriptStatus.log
----NoOfThread.sh End ----------
rrd files get generated by the poller. But there is no data in my graph. I verfied the degug link:http://docs.cacti.net/node/283
Note: I would like to confirm whether the shell script file is executed or not. My log file shellScriptStatus.log is not generated. How to execute this shell script through cacti poller.ph. I already have crontjob which my poller.php executes successfully.
Please advice if i am wrong. How to populate the data in my graph. Find the attached screenshots for my DataInputMethod configuration.
----NoOfThread.sh start ----------
#!/bin/sh
printf '10'
printf '10'
printf '10'
printf '10'
printf '10' >> shellScriptStatus.log
----NoOfThread.sh End ----------
rrd files get generated by the poller. But there is no data in my graph. I verfied the degug link:http://docs.cacti.net/node/283
Note: I would like to confirm whether the shell script file is executed or not. My log file shellScriptStatus.log is not generated. How to execute this shell script through cacti poller.ph. I already have crontjob which my poller.php executes successfully.
Please advice if i am wrong. How to populate the data in my graph. Find the attached screenshots for my DataInputMethod configuration.
- Attachments
-
- screenShots.PNG (91.43 KiB) Viewed 6548 times
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
You're completely wrong; sorry to mention this.
First, you're counting processes on local host only (the ps -ef is executed locally!).
Second, you did not follow my advice given at the first link of my sig (The Chapter on Creating a Script for Cacti). The data input method requires an output parm at least.
Please try to execute step by step of this howto. Hoepfully, everything will work. Afterwards, you may copy this example to solve your problem
Reinhard
First, you're counting processes on local host only (the ps -ef is executed locally!).
Second, you did not follow my advice given at the first link of my sig (The Chapter on Creating a Script for Cacti). The data input method requires an output parm at least.
Please try to execute step by step of this howto. Hoepfully, everything will work. Afterwards, you may copy this example to solve your problem
Reinhard
-
- Cacti User
- Posts: 137
- Joined: Mon Feb 11, 2008 3:46 am
Thanks for your info. I followed your instructions. I had configured the scirpt in DataInputMethod and i tried as follows
1) /bin/sh <path_cacti>/scripts/NoOfThread.sh
2) <path_cacti>/scripts/NoOfThread.sh
CrontJob executing the Poller file with user 'apache'. Whenever cronjob runs, the log file shows as
sh: /exec/products/apache/v223/www/html/cacti/scripts/NoOfThread.sh: Permission denied
Even i tired to change my script folder to chown -R apache:apache scripts/
but no updates. could any one guide for the same.
1) /bin/sh <path_cacti>/scripts/NoOfThread.sh
2) <path_cacti>/scripts/NoOfThread.sh
CrontJob executing the Poller file with user 'apache'. Whenever cronjob runs, the log file shows as
sh: /exec/products/apache/v223/www/html/cacti/scripts/NoOfThread.sh: Permission denied
Even i tired to change my script folder to chown -R apache:apache scripts/
but no updates. could any one guide for the same.
Who is online
Users browsing this forum: No registered users and 1 guest